snapshoting system for the documents1
This commit is contained in:
36
Cargo.lock
generated
36
Cargo.lock
generated
@@ -649,7 +649,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "client"
|
name = "client"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -668,7 +668,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"steel-core",
|
"steel-core",
|
||||||
"steel-decimal 1.0.3",
|
"steel-decimal",
|
||||||
"strum",
|
"strum",
|
||||||
"strum_macros",
|
"strum_macros",
|
||||||
"time",
|
"time",
|
||||||
@@ -721,7 +721,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "common"
|
name = "common"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"prost",
|
"prost",
|
||||||
"prost-build",
|
"prost-build",
|
||||||
@@ -4177,7 +4177,7 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "search"
|
name = "search"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"common",
|
"common",
|
||||||
@@ -4272,7 +4272,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server"
|
name = "server"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
@@ -4299,7 +4299,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
"steel-core",
|
"steel-core",
|
||||||
"steel-decimal 1.1.0",
|
"steel-decimal",
|
||||||
"steel-derive",
|
"steel-derive",
|
||||||
"tantivy",
|
"tantivy",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
@@ -4780,23 +4780,11 @@ dependencies = [
|
|||||||
"xdg",
|
"xdg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "steel-decimal"
|
|
||||||
version = "1.0.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f89e403c72338066141ad32c5f5b85904a43862c602249e22c0d678bccf792c8"
|
|
||||||
dependencies = [
|
|
||||||
"regex",
|
|
||||||
"rust_decimal",
|
|
||||||
"rust_decimal_macros",
|
|
||||||
"steel-core",
|
|
||||||
"steel-derive",
|
|
||||||
"thiserror 2.0.18",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "steel-decimal"
|
name = "steel-decimal"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "265dbafa67b48ba44e2c0e2189275b313ae527764b691538091c49c5debc602d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
"rust_decimal",
|
"rust_decimal",
|
||||||
@@ -5660,7 +5648,7 @@ checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tui-canvas"
|
name = "tui-canvas"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arboard",
|
"arboard",
|
||||||
@@ -5679,7 +5667,7 @@ dependencies = [
|
|||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"tui-canvas-validation-core 0.8.16",
|
"tui-canvas-validation-core 0.8.18",
|
||||||
"unicode-width 0.2.2",
|
"unicode-width 0.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5696,7 +5684,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tui-canvas-validation-core"
|
name = "tui-canvas-validation-core"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -5706,7 +5694,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tui-pages"
|
name = "tui-pages"
|
||||||
version = "0.8.16"
|
version = "0.8.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"nucleo",
|
"nucleo",
|
||||||
|
|||||||
2
client
2
client
Submodule client updated: 76abc12f07...3bce44d145
@@ -204,6 +204,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
.compile_protos(
|
.compile_protos(
|
||||||
&[
|
&[
|
||||||
"proto/common.proto",
|
"proto/common.proto",
|
||||||
|
"proto/document_data.proto",
|
||||||
"proto/adresar.proto",
|
"proto/adresar.proto",
|
||||||
"proto/auth.proto",
|
"proto/auth.proto",
|
||||||
"proto/backup.proto",
|
"proto/backup.proto",
|
||||||
@@ -228,6 +229,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
println!("cargo:rerun-if-changed=build.rs");
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
for proto in [
|
for proto in [
|
||||||
"proto/common.proto",
|
"proto/common.proto",
|
||||||
|
"proto/document_data.proto",
|
||||||
"proto/adresar.proto",
|
"proto/adresar.proto",
|
||||||
"proto/auth.proto",
|
"proto/auth.proto",
|
||||||
"proto/backup.proto",
|
"proto/backup.proto",
|
||||||
|
|||||||
28
common/proto/document_data.proto
Normal file
28
common/proto/document_data.proto
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package komp_ac.document_data;
|
||||||
|
|
||||||
|
service DocumentDataService {
|
||||||
|
rpc SaveGeneratedPrintJson(SaveGeneratedPrintJsonRequest) returns (SaveGeneratedPrintJsonResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
message SourceRecord {
|
||||||
|
string profile_name = 1;
|
||||||
|
string table_name = 2;
|
||||||
|
int64 table_def_id = 3;
|
||||||
|
int64 record_id = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SaveGeneratedPrintJsonRequest {
|
||||||
|
optional int64 schema_id = 1;
|
||||||
|
repeated SourceRecord source_records = 2;
|
||||||
|
optional string template_name = 3;
|
||||||
|
optional string template_kind = 4;
|
||||||
|
optional string template_path = 5;
|
||||||
|
string data_json = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SaveGeneratedPrintJsonResponse {
|
||||||
|
int64 document_run_id = 1;
|
||||||
|
int64 snapshot_id = 2;
|
||||||
|
int32 version_number = 3;
|
||||||
|
}
|
||||||
@@ -16,6 +16,9 @@ pub mod proto {
|
|||||||
pub mod common {
|
pub mod common {
|
||||||
include!("proto/komp_ac.common.rs");
|
include!("proto/komp_ac.common.rs");
|
||||||
}
|
}
|
||||||
|
pub mod document_data {
|
||||||
|
include!("proto/komp_ac.document_data.rs");
|
||||||
|
}
|
||||||
pub mod table_structure {
|
pub mod table_structure {
|
||||||
include!("proto/komp_ac.table_structure.rs");
|
include!("proto/komp_ac.table_structure.rs");
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
344
common/src/proto/komp_ac.document_data.rs
Normal file
344
common/src/proto/komp_ac.document_data.rs
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
// This file is @generated by prost-build.
|
||||||
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
|
pub struct SourceRecord {
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub profile_name: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub table_name: ::prost::alloc::string::String,
|
||||||
|
#[prost(int64, tag = "3")]
|
||||||
|
pub table_def_id: i64,
|
||||||
|
#[prost(int64, tag = "4")]
|
||||||
|
pub record_id: i64,
|
||||||
|
}
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct SaveGeneratedPrintJsonRequest {
|
||||||
|
#[prost(int64, optional, tag = "1")]
|
||||||
|
pub schema_id: ::core::option::Option<i64>,
|
||||||
|
#[prost(message, repeated, tag = "2")]
|
||||||
|
pub source_records: ::prost::alloc::vec::Vec<SourceRecord>,
|
||||||
|
#[prost(string, optional, tag = "3")]
|
||||||
|
pub template_name: ::core::option::Option<::prost::alloc::string::String>,
|
||||||
|
#[prost(string, optional, tag = "4")]
|
||||||
|
pub template_kind: ::core::option::Option<::prost::alloc::string::String>,
|
||||||
|
#[prost(string, optional, tag = "5")]
|
||||||
|
pub template_path: ::core::option::Option<::prost::alloc::string::String>,
|
||||||
|
#[prost(string, tag = "6")]
|
||||||
|
pub data_json: ::prost::alloc::string::String,
|
||||||
|
}
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
|
pub struct SaveGeneratedPrintJsonResponse {
|
||||||
|
#[prost(int64, tag = "1")]
|
||||||
|
pub document_run_id: i64,
|
||||||
|
#[prost(int64, tag = "2")]
|
||||||
|
pub snapshot_id: i64,
|
||||||
|
#[prost(int32, tag = "3")]
|
||||||
|
pub version_number: i32,
|
||||||
|
}
|
||||||
|
/// Generated client implementations.
|
||||||
|
pub mod document_data_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 DocumentDataServiceClient<T> {
|
||||||
|
inner: tonic::client::Grpc<T>,
|
||||||
|
}
|
||||||
|
impl DocumentDataServiceClient<tonic::transport::Channel> {
|
||||||
|
/// Attempt to create a new client by connecting to a given endpoint.
|
||||||
|
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> DocumentDataServiceClient<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,
|
||||||
|
) -> DocumentDataServiceClient<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,
|
||||||
|
{
|
||||||
|
DocumentDataServiceClient::new(InterceptedService::new(inner, interceptor))
|
||||||
|
}
|
||||||
|
/// Compress requests with the given encoding.
|
||||||
|
///
|
||||||
|
/// This requires the server to support it otherwise it might respond with an
|
||||||
|
/// error.
|
||||||
|
#[must_use]
|
||||||
|
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
||||||
|
self.inner = self.inner.send_compressed(encoding);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
/// Enable decompressing responses.
|
||||||
|
#[must_use]
|
||||||
|
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
||||||
|
self.inner = self.inner.accept_compressed(encoding);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
/// Limits the maximum size of a decoded message.
|
||||||
|
///
|
||||||
|
/// Default: `4MB`
|
||||||
|
#[must_use]
|
||||||
|
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
|
||||||
|
self.inner = self.inner.max_decoding_message_size(limit);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
/// Limits the maximum size of an encoded message.
|
||||||
|
///
|
||||||
|
/// Default: `usize::MAX`
|
||||||
|
#[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 save_generated_print_json(
|
||||||
|
&mut self,
|
||||||
|
request: impl tonic::IntoRequest<super::SaveGeneratedPrintJsonRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::SaveGeneratedPrintJsonResponse>,
|
||||||
|
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(
|
||||||
|
"/komp_ac.document_data.DocumentDataService/SaveGeneratedPrintJson",
|
||||||
|
);
|
||||||
|
let mut req = request.into_request();
|
||||||
|
req.extensions_mut()
|
||||||
|
.insert(
|
||||||
|
GrpcMethod::new(
|
||||||
|
"komp_ac.document_data.DocumentDataService",
|
||||||
|
"SaveGeneratedPrintJson",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
self.inner.unary(req, path, codec).await
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// Generated server implementations.
|
||||||
|
pub mod document_data_service_server {
|
||||||
|
#![allow(
|
||||||
|
unused_variables,
|
||||||
|
dead_code,
|
||||||
|
missing_docs,
|
||||||
|
clippy::wildcard_imports,
|
||||||
|
clippy::let_unit_value,
|
||||||
|
)]
|
||||||
|
use tonic::codegen::*;
|
||||||
|
/// Generated trait containing gRPC methods that should be implemented for use with DocumentDataServiceServer.
|
||||||
|
#[async_trait]
|
||||||
|
pub trait DocumentDataService: std::marker::Send + std::marker::Sync + 'static {
|
||||||
|
async fn save_generated_print_json(
|
||||||
|
&self,
|
||||||
|
request: tonic::Request<super::SaveGeneratedPrintJsonRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::SaveGeneratedPrintJsonResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
|
}
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct DocumentDataServiceServer<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> DocumentDataServiceServer<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)
|
||||||
|
}
|
||||||
|
/// Enable decompressing requests with the given encoding.
|
||||||
|
#[must_use]
|
||||||
|
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
||||||
|
self.accept_compression_encodings.enable(encoding);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
/// Compress responses with the given encoding, if the client supports it.
|
||||||
|
#[must_use]
|
||||||
|
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
||||||
|
self.send_compression_encodings.enable(encoding);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
/// Limits the maximum size of a decoded message.
|
||||||
|
///
|
||||||
|
/// Default: `4MB`
|
||||||
|
#[must_use]
|
||||||
|
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
|
||||||
|
self.max_decoding_message_size = Some(limit);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
/// Limits the maximum size of an encoded message.
|
||||||
|
///
|
||||||
|
/// Default: `usize::MAX`
|
||||||
|
#[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 DocumentDataServiceServer<T>
|
||||||
|
where
|
||||||
|
T: DocumentDataService,
|
||||||
|
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() {
|
||||||
|
"/komp_ac.document_data.DocumentDataService/SaveGeneratedPrintJson" => {
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
struct SaveGeneratedPrintJsonSvc<T: DocumentDataService>(pub Arc<T>);
|
||||||
|
impl<
|
||||||
|
T: DocumentDataService,
|
||||||
|
> tonic::server::UnaryService<super::SaveGeneratedPrintJsonRequest>
|
||||||
|
for SaveGeneratedPrintJsonSvc<T> {
|
||||||
|
type Response = super::SaveGeneratedPrintJsonResponse;
|
||||||
|
type Future = BoxFuture<
|
||||||
|
tonic::Response<Self::Response>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
|
fn call(
|
||||||
|
&mut self,
|
||||||
|
request: tonic::Request<super::SaveGeneratedPrintJsonRequest>,
|
||||||
|
) -> Self::Future {
|
||||||
|
let inner = Arc::clone(&self.0);
|
||||||
|
let fut = async move {
|
||||||
|
<T as DocumentDataService>::save_generated_print_json(
|
||||||
|
&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 = SaveGeneratedPrintJsonSvc(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 DocumentDataServiceServer<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,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// Generated gRPC service name
|
||||||
|
pub const SERVICE_NAME: &str = "komp_ac.document_data.DocumentDataService";
|
||||||
|
impl<T> tonic::server::NamedService for DocumentDataServiceServer<T> {
|
||||||
|
const NAME: &'static str = SERVICE_NAME;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
server
2
server
Submodule server updated: 4af01c35f7...f2e6dd5250
Submodule tui-canvas updated: 232034d380...b7aa87cf6b
Submodule tui-pages updated: 09fb78d1f3...9a7d24caf4
Reference in New Issue
Block a user