#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertMessageRequest {
#[prost(bytes = "vec", tag = "1")]
pub message_record: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertMessageResponse {
#[prost(string, tag = "1")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LoginRequest {
#[prost(string, tag = "1")]
pub username: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub password: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LoginResponse {
#[prost(string, tag = "1")]
pub token: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RefreshTokenRequest {
#[prost(string, tag = "1")]
pub access_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RefreshTokenResponse {
#[prost(string, tag = "1")]
pub token: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidateTokenRequest {
#[prost(string, tag = "1")]
pub token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidateTokenResponse {
#[prost(bool, tag = "1")]
pub is_authenticated: bool,
#[prost(string, tag = "2")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegisterDatasetRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub json_schema: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "5")]
pub partition_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegisterDatasetResponse {
#[prost(string, tag = "1")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub fingerprint: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertBatchRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "4")]
pub ipc_data: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "5")]
pub fingerprint: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertBatchResponse {
#[prost(uint64, tag = "1")]
pub rows_accepted: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryDatasetRequest {
#[prost(string, tag = "1")]
pub sql: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryDatasetResponse {
#[prost(bytes = "vec", tag = "1")]
pub ipc_data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListDatasetsRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DatasetInfo {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub fingerprint: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "5")]
pub partition_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "6")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub created_at: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub updated_at: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatasetsResponse {
#[prost(message, repeated, tag = "1")]
pub datasets: ::prost::alloc::vec::Vec<DatasetInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DescribeDatasetRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DescribeDatasetResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<DatasetInfo>,
#[prost(string, tag = "2")]
pub arrow_schema_json: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListCatalogsRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CatalogInfo {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub schema_count: u32,
#[prost(uint32, tag = "3")]
pub table_count: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCatalogsResponse {
#[prost(message, repeated, tag = "1")]
pub catalogs: ::prost::alloc::vec::Vec<CatalogInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSchemasRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SchemaInfo {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub table_count: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSchemasResponse {
#[prost(message, repeated, tag = "1")]
pub schemas: ::prost::alloc::vec::Vec<SchemaInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListTablesRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TableSummary {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub created_at: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub updated_at: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTablesResponse {
#[prost(message, repeated, tag = "1")]
pub tables: ::prost::alloc::vec::Vec<TableSummary>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTableDetailRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ColumnInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub arrow_type: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub nullable: bool,
#[prost(bool, tag = "4")]
pub is_partition: bool,
#[prost(bool, tag = "5")]
pub is_system: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TableStats {
#[prost(uint64, optional, tag = "1")]
pub row_count: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub file_count: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub size_bytes: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub delta_version: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTableDetailResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<DatasetInfo>,
#[prost(message, repeated, tag = "2")]
pub columns: ::prost::alloc::vec::Vec<ColumnInfo>,
#[prost(message, optional, tag = "3")]
pub stats: ::core::option::Option<TableStats>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PreviewTableRequest {
#[prost(string, tag = "1")]
pub catalog: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub table: ::prost::alloc::string::String,
#[prost(uint32, tag = "4")]
pub max_rows: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreviewTableResponse {
#[prost(bytes = "vec", tag = "1")]
pub ipc_data: ::prost::alloc::vec::Vec<u8>,
#[prost(message, repeated, tag = "2")]
pub columns: ::prost::alloc::vec::Vec<ColumnInfo>,
#[prost(uint64, tag = "3")]
pub row_count: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecuteQueryRequest {
#[prost(string, tag = "1")]
pub sql: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub query_id: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub max_rows: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryExecutionMetadata {
#[prost(string, tag = "1")]
pub query_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub rows_returned: u64,
#[prost(bool, tag = "3")]
pub truncated: bool,
#[prost(uint64, tag = "4")]
pub execution_time_ms: u64,
#[prost(uint64, optional, tag = "5")]
pub bytes_scanned: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecuteQueryResponse {
#[prost(bytes = "vec", tag = "1")]
pub ipc_data: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub metadata: ::core::option::Option<QueryExecutionMetadata>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CancelQueryRequest {
#[prost(string, tag = "1")]
pub query_id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CancelQueryResponse {
#[prost(bool, tag = "1")]
pub cancelled: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExplainQueryRequest {
#[prost(string, tag = "1")]
pub sql: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub analyze: bool,
#[prost(uint32, tag = "3")]
pub max_rows: u32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PlanNodeMetrics {
#[prost(uint64, optional, tag = "1")]
pub output_rows: ::core::option::Option<u64>,
#[prost(double, optional, tag = "2")]
pub elapsed_ms: ::core::option::Option<f64>,
#[prost(uint64, optional, tag = "3")]
pub bytes_scanned: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub spill_bytes: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PlanNodeField {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanNode {
#[prost(string, tag = "1")]
pub node_type: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub fields: ::prost::alloc::vec::Vec<PlanNodeField>,
#[prost(message, repeated, tag = "4")]
pub children: ::prost::alloc::vec::Vec<PlanNode>,
#[prost(message, optional, tag = "5")]
pub metrics: ::core::option::Option<PlanNodeMetrics>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExplainQueryResponse {
#[prost(message, optional, tag = "1")]
pub logical_plan: ::core::option::Option<PlanNode>,
#[prost(message, optional, tag = "2")]
pub physical_plan: ::core::option::Option<PlanNode>,
#[prost(string, tag = "3")]
pub logical_plan_text: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub physical_plan_text: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub execution_metadata: ::core::option::Option<QueryExecutionMetadata>,
}
pub mod message_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MessageServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MessageServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MessageServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MessageServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
MessageServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn insert_message(
&mut self,
request: impl tonic::IntoRequest<super::InsertMessageRequest>,
) -> std::result::Result<
tonic::Response<super::InsertMessageResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.MessageService/InsertMessage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.MessageService", "InsertMessage"),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod message_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait MessageService: std::marker::Send + std::marker::Sync + 'static {
async fn insert_message(
&self,
request: tonic::Request<super::InsertMessageRequest>,
) -> std::result::Result<
tonic::Response<super::InsertMessageResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct MessageServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> MessageServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for MessageServiceServer<T>
where
T: MessageService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/scouter.grpc.v1.MessageService/InsertMessage" => {
#[allow(non_camel_case_types)]
struct InsertMessageSvc<T: MessageService>(pub Arc<T>);
impl<
T: MessageService,
> tonic::server::UnaryService<super::InsertMessageRequest>
for InsertMessageSvc<T> {
type Response = super::InsertMessageResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InsertMessageRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MessageService>::insert_message(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = InsertMessageSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for MessageServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "scouter.grpc.v1.MessageService";
impl<T> tonic::server::NamedService for MessageServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod auth_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct AuthServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl AuthServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> AuthServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> AuthServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
AuthServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn login(
&mut self,
request: impl tonic::IntoRequest<super::LoginRequest>,
) -> std::result::Result<tonic::Response<super::LoginResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.AuthService/Login",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scouter.grpc.v1.AuthService", "Login"));
self.inner.unary(req, path, codec).await
}
pub async fn refresh_token(
&mut self,
request: impl tonic::IntoRequest<super::RefreshTokenRequest>,
) -> std::result::Result<
tonic::Response<super::RefreshTokenResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.AuthService/RefreshToken",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scouter.grpc.v1.AuthService", "RefreshToken"));
self.inner.unary(req, path, codec).await
}
pub async fn validate_token(
&mut self,
request: impl tonic::IntoRequest<super::ValidateTokenRequest>,
) -> std::result::Result<
tonic::Response<super::ValidateTokenResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.AuthService/ValidateToken",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scouter.grpc.v1.AuthService", "ValidateToken"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod auth_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait AuthService: std::marker::Send + std::marker::Sync + 'static {
async fn login(
&self,
request: tonic::Request<super::LoginRequest>,
) -> std::result::Result<tonic::Response<super::LoginResponse>, tonic::Status>;
async fn refresh_token(
&self,
request: tonic::Request<super::RefreshTokenRequest>,
) -> std::result::Result<
tonic::Response<super::RefreshTokenResponse>,
tonic::Status,
>;
async fn validate_token(
&self,
request: tonic::Request<super::ValidateTokenRequest>,
) -> std::result::Result<
tonic::Response<super::ValidateTokenResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct AuthServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> AuthServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for AuthServiceServer<T>
where
T: AuthService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/scouter.grpc.v1.AuthService/Login" => {
#[allow(non_camel_case_types)]
struct LoginSvc<T: AuthService>(pub Arc<T>);
impl<T: AuthService> tonic::server::UnaryService<super::LoginRequest>
for LoginSvc<T> {
type Response = super::LoginResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::LoginRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AuthService>::login(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = LoginSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.AuthService/RefreshToken" => {
#[allow(non_camel_case_types)]
struct RefreshTokenSvc<T: AuthService>(pub Arc<T>);
impl<
T: AuthService,
> tonic::server::UnaryService<super::RefreshTokenRequest>
for RefreshTokenSvc<T> {
type Response = super::RefreshTokenResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RefreshTokenRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AuthService>::refresh_token(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RefreshTokenSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.AuthService/ValidateToken" => {
#[allow(non_camel_case_types)]
struct ValidateTokenSvc<T: AuthService>(pub Arc<T>);
impl<
T: AuthService,
> tonic::server::UnaryService<super::ValidateTokenRequest>
for ValidateTokenSvc<T> {
type Response = super::ValidateTokenResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ValidateTokenRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AuthService>::validate_token(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ValidateTokenSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for AuthServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "scouter.grpc.v1.AuthService";
impl<T> tonic::server::NamedService for AuthServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod dataset_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DatasetServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DatasetServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DatasetServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DatasetServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DatasetServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn register_dataset(
&mut self,
request: impl tonic::IntoRequest<super::RegisterDatasetRequest>,
) -> std::result::Result<
tonic::Response<super::RegisterDatasetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/RegisterDataset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "RegisterDataset"),
);
self.inner.unary(req, path, codec).await
}
pub async fn insert_batch(
&mut self,
request: impl tonic::IntoRequest<super::InsertBatchRequest>,
) -> std::result::Result<
tonic::Response<super::InsertBatchResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/InsertBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "InsertBatch"),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_dataset(
&mut self,
request: impl tonic::IntoRequest<super::QueryDatasetRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDatasetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/QueryDataset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "QueryDataset"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_datasets(
&mut self,
request: impl tonic::IntoRequest<super::ListDatasetsRequest>,
) -> std::result::Result<
tonic::Response<super::ListDatasetsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/ListDatasets",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "ListDatasets"),
);
self.inner.unary(req, path, codec).await
}
pub async fn describe_dataset(
&mut self,
request: impl tonic::IntoRequest<super::DescribeDatasetRequest>,
) -> std::result::Result<
tonic::Response<super::DescribeDatasetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/DescribeDataset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "DescribeDataset"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_catalogs(
&mut self,
request: impl tonic::IntoRequest<super::ListCatalogsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCatalogsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/ListCatalogs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "ListCatalogs"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_schemas(
&mut self,
request: impl tonic::IntoRequest<super::ListSchemasRequest>,
) -> std::result::Result<
tonic::Response<super::ListSchemasResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/ListSchemas",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "ListSchemas"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_tables(
&mut self,
request: impl tonic::IntoRequest<super::ListTablesRequest>,
) -> std::result::Result<
tonic::Response<super::ListTablesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/ListTables",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scouter.grpc.v1.DatasetService", "ListTables"));
self.inner.unary(req, path, codec).await
}
pub async fn get_table_detail(
&mut self,
request: impl tonic::IntoRequest<super::GetTableDetailRequest>,
) -> std::result::Result<
tonic::Response<super::GetTableDetailResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/GetTableDetail",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "GetTableDetail"),
);
self.inner.unary(req, path, codec).await
}
pub async fn preview_table(
&mut self,
request: impl tonic::IntoRequest<super::PreviewTableRequest>,
) -> std::result::Result<
tonic::Response<super::PreviewTableResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/PreviewTable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "PreviewTable"),
);
self.inner.unary(req, path, codec).await
}
pub async fn execute_query(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteQueryRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteQueryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/ExecuteQuery",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "ExecuteQuery"),
);
self.inner.unary(req, path, codec).await
}
pub async fn cancel_query(
&mut self,
request: impl tonic::IntoRequest<super::CancelQueryRequest>,
) -> std::result::Result<
tonic::Response<super::CancelQueryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/CancelQuery",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "CancelQuery"),
);
self.inner.unary(req, path, codec).await
}
pub async fn explain_query(
&mut self,
request: impl tonic::IntoRequest<super::ExplainQueryRequest>,
) -> std::result::Result<
tonic::Response<super::ExplainQueryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/scouter.grpc.v1.DatasetService/ExplainQuery",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scouter.grpc.v1.DatasetService", "ExplainQuery"),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod dataset_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait DatasetService: std::marker::Send + std::marker::Sync + 'static {
async fn register_dataset(
&self,
request: tonic::Request<super::RegisterDatasetRequest>,
) -> std::result::Result<
tonic::Response<super::RegisterDatasetResponse>,
tonic::Status,
>;
async fn insert_batch(
&self,
request: tonic::Request<super::InsertBatchRequest>,
) -> std::result::Result<
tonic::Response<super::InsertBatchResponse>,
tonic::Status,
>;
async fn query_dataset(
&self,
request: tonic::Request<super::QueryDatasetRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDatasetResponse>,
tonic::Status,
>;
async fn list_datasets(
&self,
request: tonic::Request<super::ListDatasetsRequest>,
) -> std::result::Result<
tonic::Response<super::ListDatasetsResponse>,
tonic::Status,
>;
async fn describe_dataset(
&self,
request: tonic::Request<super::DescribeDatasetRequest>,
) -> std::result::Result<
tonic::Response<super::DescribeDatasetResponse>,
tonic::Status,
>;
async fn list_catalogs(
&self,
request: tonic::Request<super::ListCatalogsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCatalogsResponse>,
tonic::Status,
>;
async fn list_schemas(
&self,
request: tonic::Request<super::ListSchemasRequest>,
) -> std::result::Result<
tonic::Response<super::ListSchemasResponse>,
tonic::Status,
>;
async fn list_tables(
&self,
request: tonic::Request<super::ListTablesRequest>,
) -> std::result::Result<
tonic::Response<super::ListTablesResponse>,
tonic::Status,
>;
async fn get_table_detail(
&self,
request: tonic::Request<super::GetTableDetailRequest>,
) -> std::result::Result<
tonic::Response<super::GetTableDetailResponse>,
tonic::Status,
>;
async fn preview_table(
&self,
request: tonic::Request<super::PreviewTableRequest>,
) -> std::result::Result<
tonic::Response<super::PreviewTableResponse>,
tonic::Status,
>;
async fn execute_query(
&self,
request: tonic::Request<super::ExecuteQueryRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteQueryResponse>,
tonic::Status,
>;
async fn cancel_query(
&self,
request: tonic::Request<super::CancelQueryRequest>,
) -> std::result::Result<
tonic::Response<super::CancelQueryResponse>,
tonic::Status,
>;
async fn explain_query(
&self,
request: tonic::Request<super::ExplainQueryRequest>,
) -> std::result::Result<
tonic::Response<super::ExplainQueryResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct DatasetServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> DatasetServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for DatasetServiceServer<T>
where
T: DatasetService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/scouter.grpc.v1.DatasetService/RegisterDataset" => {
#[allow(non_camel_case_types)]
struct RegisterDatasetSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::RegisterDatasetRequest>
for RegisterDatasetSvc<T> {
type Response = super::RegisterDatasetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RegisterDatasetRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::register_dataset(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RegisterDatasetSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/InsertBatch" => {
#[allow(non_camel_case_types)]
struct InsertBatchSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::InsertBatchRequest>
for InsertBatchSvc<T> {
type Response = super::InsertBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InsertBatchRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::insert_batch(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = InsertBatchSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/QueryDataset" => {
#[allow(non_camel_case_types)]
struct QueryDatasetSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::QueryDatasetRequest>
for QueryDatasetSvc<T> {
type Response = super::QueryDatasetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryDatasetRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::query_dataset(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryDatasetSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/ListDatasets" => {
#[allow(non_camel_case_types)]
struct ListDatasetsSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::ListDatasetsRequest>
for ListDatasetsSvc<T> {
type Response = super::ListDatasetsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListDatasetsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::list_datasets(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListDatasetsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/DescribeDataset" => {
#[allow(non_camel_case_types)]
struct DescribeDatasetSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::DescribeDatasetRequest>
for DescribeDatasetSvc<T> {
type Response = super::DescribeDatasetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DescribeDatasetRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::describe_dataset(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DescribeDatasetSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/ListCatalogs" => {
#[allow(non_camel_case_types)]
struct ListCatalogsSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::ListCatalogsRequest>
for ListCatalogsSvc<T> {
type Response = super::ListCatalogsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListCatalogsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::list_catalogs(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListCatalogsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/ListSchemas" => {
#[allow(non_camel_case_types)]
struct ListSchemasSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::ListSchemasRequest>
for ListSchemasSvc<T> {
type Response = super::ListSchemasResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListSchemasRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::list_schemas(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListSchemasSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/ListTables" => {
#[allow(non_camel_case_types)]
struct ListTablesSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::ListTablesRequest>
for ListTablesSvc<T> {
type Response = super::ListTablesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListTablesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::list_tables(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListTablesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/GetTableDetail" => {
#[allow(non_camel_case_types)]
struct GetTableDetailSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::GetTableDetailRequest>
for GetTableDetailSvc<T> {
type Response = super::GetTableDetailResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetTableDetailRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::get_table_detail(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetTableDetailSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/PreviewTable" => {
#[allow(non_camel_case_types)]
struct PreviewTableSvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::PreviewTableRequest>
for PreviewTableSvc<T> {
type Response = super::PreviewTableResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PreviewTableRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::preview_table(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = PreviewTableSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/ExecuteQuery" => {
#[allow(non_camel_case_types)]
struct ExecuteQuerySvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::ExecuteQueryRequest>
for ExecuteQuerySvc<T> {
type Response = super::ExecuteQueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExecuteQueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::execute_query(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteQuerySvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/CancelQuery" => {
#[allow(non_camel_case_types)]
struct CancelQuerySvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::CancelQueryRequest>
for CancelQuerySvc<T> {
type Response = super::CancelQueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CancelQueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::cancel_query(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CancelQuerySvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scouter.grpc.v1.DatasetService/ExplainQuery" => {
#[allow(non_camel_case_types)]
struct ExplainQuerySvc<T: DatasetService>(pub Arc<T>);
impl<
T: DatasetService,
> tonic::server::UnaryService<super::ExplainQueryRequest>
for ExplainQuerySvc<T> {
type Response = super::ExplainQueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExplainQueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DatasetService>::explain_query(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExplainQuerySvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for DatasetServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "scouter.grpc.v1.DatasetService";
impl<T> tonic::server::NamedService for DatasetServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}