mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 12:57:42 +00:00
90d67846e6
Signed-off-by: junxiang Mu <1948535941@qq.com>
2369 lines
125 KiB
Rust
2369 lines
125 KiB
Rust
// This file is @generated by prost-build.
|
|
/// --------------------------------------------------------------------
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct PingRequest {
|
|
#[prost(uint64, tag = "1")]
|
|
pub version: u64,
|
|
#[prost(bytes = "vec", tag = "2")]
|
|
pub body: ::prost::alloc::vec::Vec<u8>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct PingResponse {
|
|
#[prost(uint64, tag = "1")]
|
|
pub version: u64,
|
|
#[prost(bytes = "vec", tag = "2")]
|
|
pub body: ::prost::alloc::vec::Vec<u8>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListBucketRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub options: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListBucketResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub bucket_infos: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct MakeBucketRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub options: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct MakeBucketResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct GetBucketInfoRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub bucket: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub options: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct GetBucketInfoResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, tag = "2")]
|
|
pub bucket_info: ::prost::alloc::string::String,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteBucketRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub bucket: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteBucketResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadAllRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadAllResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(bytes = "vec", tag = "2")]
|
|
pub data: ::prost::alloc::vec::Vec<u8>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WriteAllRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(bytes = "vec", tag = "4")]
|
|
pub data: ::prost::alloc::vec::Vec<u8>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WriteAllResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub options: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RenamePartRequst {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub src_volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub src_path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub dst_volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub dst_path: ::prost::alloc::string::String,
|
|
#[prost(bytes = "vec", tag = "6")]
|
|
pub meta: ::prost::alloc::vec::Vec<u8>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RenamePartResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RenameFileRequst {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub src_volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub src_path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub dst_volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub dst_path: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RenameFileResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WriteRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(bool, tag = "4")]
|
|
pub is_append: bool,
|
|
#[prost(bytes = "vec", tag = "5")]
|
|
pub data: ::prost::alloc::vec::Vec<u8>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WriteResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadAtRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "4")]
|
|
pub offset: i64,
|
|
#[prost(int64, tag = "5")]
|
|
pub length: i64,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadAtResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(bytes = "vec", tag = "2")]
|
|
pub data: ::prost::alloc::vec::Vec<u8>,
|
|
#[prost(int64, tag = "3")]
|
|
pub read_size: i64,
|
|
#[prost(string, optional, tag = "4")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListDirRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListDirResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub volumes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WalkDirRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub walk_dir_options: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WalkDirResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub meta_cache_entry: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RenameDataRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub src_volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub src_path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub file_info: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub dst_volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub dst_path: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RenameDataResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, tag = "2")]
|
|
pub rename_data_resp: ::prost::alloc::string::String,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct MakeVolumesRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub volumes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct MakeVolumesResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct MakeVolumeRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct MakeVolumeResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListVolumesRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListVolumesResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub volume_infos: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct StatVolumeRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct StatVolumeResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, tag = "2")]
|
|
pub volume_info: ::prost::alloc::string::String,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeletePathsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, repeated, tag = "3")]
|
|
pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeletePathsResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct UpdateMetadataRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub file_info: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub opts: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct UpdateMetadataResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WriteMetadataRequest {
|
|
/// indicate which one in the disks
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub file_info: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct WriteMetadataResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadVersionRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub version_id: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub opts: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadVersionResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, tag = "2")]
|
|
pub file_info: ::prost::alloc::string::String,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadXlRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(bool, tag = "4")]
|
|
pub read_data: bool,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadXlResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, tag = "2")]
|
|
pub raw_file_info: ::prost::alloc::string::String,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteVersionRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub path: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub file_info: ::prost::alloc::string::String,
|
|
#[prost(bool, tag = "5")]
|
|
pub force_del_marker: bool,
|
|
#[prost(string, tag = "6")]
|
|
pub opts: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteVersionResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, tag = "2")]
|
|
pub raw_file_info: ::prost::alloc::string::String,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteVersionsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
#[prost(string, repeated, tag = "3")]
|
|
pub versions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, tag = "4")]
|
|
pub opts: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteVersionsResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadMultipleRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub read_multiple_req: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ReadMultipleResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, repeated, tag = "2")]
|
|
pub read_multiple_resps: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteVolumeRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub disk: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub volume: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct DeleteVolumeResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
/// lock api have same argument type
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct GenerallyLockRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub args: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct GenerallyLockResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub success: bool,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub error_info: ::core::option::Option<::prost::alloc::string::String>,
|
|
}
|
|
/// Generated client implementations.
|
|
pub mod node_service_client {
|
|
#![allow(unused_variables, dead_code, missing_docs, clippy::wildcard_imports, clippy::let_unit_value)]
|
|
use tonic::codegen::http::Uri;
|
|
use tonic::codegen::*;
|
|
#[derive(Debug, Clone)]
|
|
pub struct NodeServiceClient<T> {
|
|
inner: tonic::client::Grpc<T>,
|
|
}
|
|
impl NodeServiceClient<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> NodeServiceClient<T>
|
|
where
|
|
T: tonic::client::GrpcService<tonic::body::BoxBody>,
|
|
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) -> NodeServiceClient<InterceptedService<T, F>>
|
|
where
|
|
F: tonic::service::Interceptor,
|
|
T::ResponseBody: Default,
|
|
T: tonic::codegen::Service<
|
|
http::Request<tonic::body::BoxBody>,
|
|
Response = http::Response<<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody>,
|
|
>,
|
|
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
|
|
Into<StdError> + std::marker::Send + std::marker::Sync,
|
|
{
|
|
NodeServiceClient::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
|
|
}
|
|
/// -------------------------------meta service--------------------------
|
|
pub async fn ping(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::PingRequest>,
|
|
) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/Ping");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "Ping"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn list_bucket(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ListBucketRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ListBucketResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ListBucket");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ListBucket"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn make_bucket(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::MakeBucketRequest>,
|
|
) -> std::result::Result<tonic::Response<super::MakeBucketResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/MakeBucket");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "MakeBucket"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn get_bucket_info(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GetBucketInfoRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GetBucketInfoResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/GetBucketInfo");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "GetBucketInfo"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn delete_bucket(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::DeleteBucketRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteBucketResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/DeleteBucket");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "DeleteBucket"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn read_all(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ReadAllRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadAllResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ReadAll");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ReadAll"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn write_all(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::WriteAllRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WriteAllResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/WriteAll");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "WriteAll"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn delete(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::DeleteRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/Delete");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "Delete"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn rename_part(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::RenamePartRequst>,
|
|
) -> std::result::Result<tonic::Response<super::RenamePartResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/RenamePart");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "RenamePart"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn rename_file(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::RenameFileRequst>,
|
|
) -> std::result::Result<tonic::Response<super::RenameFileResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/RenameFile");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "RenameFile"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn write(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::WriteRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WriteResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/Write");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "Write"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn write_stream(
|
|
&mut self,
|
|
request: impl tonic::IntoStreamingRequest<Message = super::WriteRequest>,
|
|
) -> std::result::Result<tonic::Response<tonic::codec::Streaming<super::WriteResponse>>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/WriteStream");
|
|
let mut req = request.into_streaming_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "WriteStream"));
|
|
self.inner.streaming(req, path, codec).await
|
|
}
|
|
/// rpc Append(AppendRequest) returns (AppendResponse) {};
|
|
pub async fn read_at(
|
|
&mut self,
|
|
request: impl tonic::IntoStreamingRequest<Message = super::ReadAtRequest>,
|
|
) -> std::result::Result<tonic::Response<tonic::codec::Streaming<super::ReadAtResponse>>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ReadAt");
|
|
let mut req = request.into_streaming_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ReadAt"));
|
|
self.inner.streaming(req, path, codec).await
|
|
}
|
|
pub async fn list_dir(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ListDirRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ListDirResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ListDir");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ListDir"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn walk_dir(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::WalkDirRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WalkDirResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/WalkDir");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "WalkDir"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn rename_data(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::RenameDataRequest>,
|
|
) -> std::result::Result<tonic::Response<super::RenameDataResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/RenameData");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "RenameData"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn make_volumes(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::MakeVolumesRequest>,
|
|
) -> std::result::Result<tonic::Response<super::MakeVolumesResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/MakeVolumes");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "MakeVolumes"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn make_volume(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::MakeVolumeRequest>,
|
|
) -> std::result::Result<tonic::Response<super::MakeVolumeResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/MakeVolume");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "MakeVolume"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn list_volumes(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ListVolumesRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ListVolumesResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ListVolumes");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ListVolumes"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn stat_volume(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::StatVolumeRequest>,
|
|
) -> std::result::Result<tonic::Response<super::StatVolumeResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/StatVolume");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "StatVolume"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn delete_paths(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::DeletePathsRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeletePathsResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/DeletePaths");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "DeletePaths"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn update_metadata(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::UpdateMetadataRequest>,
|
|
) -> std::result::Result<tonic::Response<super::UpdateMetadataResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/UpdateMetadata");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "UpdateMetadata"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn write_metadata(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::WriteMetadataRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WriteMetadataResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/WriteMetadata");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "WriteMetadata"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn read_version(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ReadVersionRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadVersionResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ReadVersion");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ReadVersion"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn read_xl(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ReadXlRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadXlResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ReadXL");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ReadXL"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn delete_version(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::DeleteVersionRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteVersionResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/DeleteVersion");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "DeleteVersion"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn delete_versions(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::DeleteVersionsRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteVersionsResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/DeleteVersions");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "DeleteVersions"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn read_multiple(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ReadMultipleRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadMultipleResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ReadMultiple");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ReadMultiple"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn delete_volume(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::DeleteVolumeRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteVolumeResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/DeleteVolume");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "DeleteVolume"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn lock(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/Lock");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "Lock"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn un_lock(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/UnLock");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "UnLock"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn r_lock(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/RLock");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "RLock"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn r_un_lock(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/RUnLock");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "RUnLock"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn force_un_lock(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/ForceUnLock");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "ForceUnLock"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn refresh(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status> {
|
|
self.inner
|
|
.ready()
|
|
.await
|
|
.map_err(|e| tonic::Status::unknown(format!("Service was not ready: {}", e.into())))?;
|
|
let codec = tonic::codec::ProstCodec::default();
|
|
let path = http::uri::PathAndQuery::from_static("/node_service.NodeService/Refresh");
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("node_service.NodeService", "Refresh"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
}
|
|
}
|
|
/// Generated server implementations.
|
|
pub mod node_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 NodeServiceServer.
|
|
#[async_trait]
|
|
pub trait NodeService: std::marker::Send + std::marker::Sync + 'static {
|
|
/// -------------------------------meta service--------------------------
|
|
async fn ping(
|
|
&self,
|
|
request: tonic::Request<super::PingRequest>,
|
|
) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status>;
|
|
async fn list_bucket(
|
|
&self,
|
|
request: tonic::Request<super::ListBucketRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ListBucketResponse>, tonic::Status>;
|
|
async fn make_bucket(
|
|
&self,
|
|
request: tonic::Request<super::MakeBucketRequest>,
|
|
) -> std::result::Result<tonic::Response<super::MakeBucketResponse>, tonic::Status>;
|
|
async fn get_bucket_info(
|
|
&self,
|
|
request: tonic::Request<super::GetBucketInfoRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GetBucketInfoResponse>, tonic::Status>;
|
|
async fn delete_bucket(
|
|
&self,
|
|
request: tonic::Request<super::DeleteBucketRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteBucketResponse>, tonic::Status>;
|
|
async fn read_all(
|
|
&self,
|
|
request: tonic::Request<super::ReadAllRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadAllResponse>, tonic::Status>;
|
|
async fn write_all(
|
|
&self,
|
|
request: tonic::Request<super::WriteAllRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WriteAllResponse>, tonic::Status>;
|
|
async fn delete(
|
|
&self,
|
|
request: tonic::Request<super::DeleteRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status>;
|
|
async fn rename_part(
|
|
&self,
|
|
request: tonic::Request<super::RenamePartRequst>,
|
|
) -> std::result::Result<tonic::Response<super::RenamePartResponse>, tonic::Status>;
|
|
async fn rename_file(
|
|
&self,
|
|
request: tonic::Request<super::RenameFileRequst>,
|
|
) -> std::result::Result<tonic::Response<super::RenameFileResponse>, tonic::Status>;
|
|
async fn write(
|
|
&self,
|
|
request: tonic::Request<super::WriteRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WriteResponse>, tonic::Status>;
|
|
/// Server streaming response type for the WriteStream method.
|
|
type WriteStreamStream: tonic::codegen::tokio_stream::Stream<Item = std::result::Result<super::WriteResponse, tonic::Status>>
|
|
+ std::marker::Send
|
|
+ 'static;
|
|
async fn write_stream(
|
|
&self,
|
|
request: tonic::Request<tonic::Streaming<super::WriteRequest>>,
|
|
) -> std::result::Result<tonic::Response<Self::WriteStreamStream>, tonic::Status>;
|
|
/// Server streaming response type for the ReadAt method.
|
|
type ReadAtStream: tonic::codegen::tokio_stream::Stream<Item = std::result::Result<super::ReadAtResponse, tonic::Status>>
|
|
+ std::marker::Send
|
|
+ 'static;
|
|
/// rpc Append(AppendRequest) returns (AppendResponse) {};
|
|
async fn read_at(
|
|
&self,
|
|
request: tonic::Request<tonic::Streaming<super::ReadAtRequest>>,
|
|
) -> std::result::Result<tonic::Response<Self::ReadAtStream>, tonic::Status>;
|
|
async fn list_dir(
|
|
&self,
|
|
request: tonic::Request<super::ListDirRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ListDirResponse>, tonic::Status>;
|
|
async fn walk_dir(
|
|
&self,
|
|
request: tonic::Request<super::WalkDirRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WalkDirResponse>, tonic::Status>;
|
|
async fn rename_data(
|
|
&self,
|
|
request: tonic::Request<super::RenameDataRequest>,
|
|
) -> std::result::Result<tonic::Response<super::RenameDataResponse>, tonic::Status>;
|
|
async fn make_volumes(
|
|
&self,
|
|
request: tonic::Request<super::MakeVolumesRequest>,
|
|
) -> std::result::Result<tonic::Response<super::MakeVolumesResponse>, tonic::Status>;
|
|
async fn make_volume(
|
|
&self,
|
|
request: tonic::Request<super::MakeVolumeRequest>,
|
|
) -> std::result::Result<tonic::Response<super::MakeVolumeResponse>, tonic::Status>;
|
|
async fn list_volumes(
|
|
&self,
|
|
request: tonic::Request<super::ListVolumesRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ListVolumesResponse>, tonic::Status>;
|
|
async fn stat_volume(
|
|
&self,
|
|
request: tonic::Request<super::StatVolumeRequest>,
|
|
) -> std::result::Result<tonic::Response<super::StatVolumeResponse>, tonic::Status>;
|
|
async fn delete_paths(
|
|
&self,
|
|
request: tonic::Request<super::DeletePathsRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeletePathsResponse>, tonic::Status>;
|
|
async fn update_metadata(
|
|
&self,
|
|
request: tonic::Request<super::UpdateMetadataRequest>,
|
|
) -> std::result::Result<tonic::Response<super::UpdateMetadataResponse>, tonic::Status>;
|
|
async fn write_metadata(
|
|
&self,
|
|
request: tonic::Request<super::WriteMetadataRequest>,
|
|
) -> std::result::Result<tonic::Response<super::WriteMetadataResponse>, tonic::Status>;
|
|
async fn read_version(
|
|
&self,
|
|
request: tonic::Request<super::ReadVersionRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadVersionResponse>, tonic::Status>;
|
|
async fn read_xl(
|
|
&self,
|
|
request: tonic::Request<super::ReadXlRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadXlResponse>, tonic::Status>;
|
|
async fn delete_version(
|
|
&self,
|
|
request: tonic::Request<super::DeleteVersionRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteVersionResponse>, tonic::Status>;
|
|
async fn delete_versions(
|
|
&self,
|
|
request: tonic::Request<super::DeleteVersionsRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteVersionsResponse>, tonic::Status>;
|
|
async fn read_multiple(
|
|
&self,
|
|
request: tonic::Request<super::ReadMultipleRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ReadMultipleResponse>, tonic::Status>;
|
|
async fn delete_volume(
|
|
&self,
|
|
request: tonic::Request<super::DeleteVolumeRequest>,
|
|
) -> std::result::Result<tonic::Response<super::DeleteVolumeResponse>, tonic::Status>;
|
|
async fn lock(
|
|
&self,
|
|
request: tonic::Request<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status>;
|
|
async fn un_lock(
|
|
&self,
|
|
request: tonic::Request<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status>;
|
|
async fn r_lock(
|
|
&self,
|
|
request: tonic::Request<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status>;
|
|
async fn r_un_lock(
|
|
&self,
|
|
request: tonic::Request<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status>;
|
|
async fn force_un_lock(
|
|
&self,
|
|
request: tonic::Request<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status>;
|
|
async fn refresh(
|
|
&self,
|
|
request: tonic::Request<super::GenerallyLockRequest>,
|
|
) -> std::result::Result<tonic::Response<super::GenerallyLockResponse>, tonic::Status>;
|
|
}
|
|
#[derive(Debug)]
|
|
pub struct NodeServiceServer<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> NodeServiceServer<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 NodeServiceServer<T>
|
|
where
|
|
T: NodeService,
|
|
B: Body + std::marker::Send + 'static,
|
|
B::Error: Into<StdError> + std::marker::Send + 'static,
|
|
{
|
|
type Response = http::Response<tonic::body::BoxBody>;
|
|
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() {
|
|
"/node_service.NodeService/Ping" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct PingSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::PingRequest> for PingSvc<T> {
|
|
type Response = super::PingResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::PingRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::ping(&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 = PingSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ListBucket" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ListBucketSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ListBucketRequest> for ListBucketSvc<T> {
|
|
type Response = super::ListBucketResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ListBucketRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::list_bucket(&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 = ListBucketSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/MakeBucket" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct MakeBucketSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::MakeBucketRequest> for MakeBucketSvc<T> {
|
|
type Response = super::MakeBucketResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::MakeBucketRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::make_bucket(&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 = MakeBucketSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/GetBucketInfo" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GetBucketInfoSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GetBucketInfoRequest> for GetBucketInfoSvc<T> {
|
|
type Response = super::GetBucketInfoResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GetBucketInfoRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::get_bucket_info(&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 = GetBucketInfoSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/DeleteBucket" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct DeleteBucketSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::DeleteBucketRequest> for DeleteBucketSvc<T> {
|
|
type Response = super::DeleteBucketResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::DeleteBucketRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::delete_bucket(&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 = DeleteBucketSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ReadAll" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReadAllSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ReadAllRequest> for ReadAllSvc<T> {
|
|
type Response = super::ReadAllResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ReadAllRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::read_all(&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 = ReadAllSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/WriteAll" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct WriteAllSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::WriteAllRequest> for WriteAllSvc<T> {
|
|
type Response = super::WriteAllResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::WriteAllRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::write_all(&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 = WriteAllSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/Delete" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct DeleteSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::DeleteRequest> for DeleteSvc<T> {
|
|
type Response = super::DeleteResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::DeleteRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::delete(&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 = DeleteSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/RenamePart" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct RenamePartSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::RenamePartRequst> for RenamePartSvc<T> {
|
|
type Response = super::RenamePartResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::RenamePartRequst>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::rename_part(&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 = RenamePartSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/RenameFile" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct RenameFileSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::RenameFileRequst> for RenameFileSvc<T> {
|
|
type Response = super::RenameFileResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::RenameFileRequst>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::rename_file(&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 = RenameFileSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/Write" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct WriteSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::WriteRequest> for WriteSvc<T> {
|
|
type Response = super::WriteResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::WriteRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::write(&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 = WriteSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/WriteStream" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct WriteStreamSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::StreamingService<super::WriteRequest> for WriteStreamSvc<T> {
|
|
type Response = super::WriteResponse;
|
|
type ResponseStream = T::WriteStreamStream;
|
|
type Future = BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<tonic::Streaming<super::WriteRequest>>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::write_stream(&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 = WriteStreamSvc(inner);
|
|
let codec = tonic::codec::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.streaming(method, req).await;
|
|
Ok(res)
|
|
};
|
|
Box::pin(fut)
|
|
}
|
|
"/node_service.NodeService/ReadAt" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReadAtSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::StreamingService<super::ReadAtRequest> for ReadAtSvc<T> {
|
|
type Response = super::ReadAtResponse;
|
|
type ResponseStream = T::ReadAtStream;
|
|
type Future = BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<tonic::Streaming<super::ReadAtRequest>>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::read_at(&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 = ReadAtSvc(inner);
|
|
let codec = tonic::codec::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.streaming(method, req).await;
|
|
Ok(res)
|
|
};
|
|
Box::pin(fut)
|
|
}
|
|
"/node_service.NodeService/ListDir" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ListDirSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ListDirRequest> for ListDirSvc<T> {
|
|
type Response = super::ListDirResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ListDirRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::list_dir(&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 = ListDirSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/WalkDir" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct WalkDirSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::WalkDirRequest> for WalkDirSvc<T> {
|
|
type Response = super::WalkDirResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::WalkDirRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::walk_dir(&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 = WalkDirSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/RenameData" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct RenameDataSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::RenameDataRequest> for RenameDataSvc<T> {
|
|
type Response = super::RenameDataResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::RenameDataRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::rename_data(&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 = RenameDataSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/MakeVolumes" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct MakeVolumesSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::MakeVolumesRequest> for MakeVolumesSvc<T> {
|
|
type Response = super::MakeVolumesResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::MakeVolumesRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::make_volumes(&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 = MakeVolumesSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/MakeVolume" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct MakeVolumeSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::MakeVolumeRequest> for MakeVolumeSvc<T> {
|
|
type Response = super::MakeVolumeResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::MakeVolumeRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::make_volume(&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 = MakeVolumeSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ListVolumes" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ListVolumesSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ListVolumesRequest> for ListVolumesSvc<T> {
|
|
type Response = super::ListVolumesResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ListVolumesRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::list_volumes(&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 = ListVolumesSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/StatVolume" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct StatVolumeSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::StatVolumeRequest> for StatVolumeSvc<T> {
|
|
type Response = super::StatVolumeResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::StatVolumeRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::stat_volume(&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 = StatVolumeSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/DeletePaths" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct DeletePathsSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::DeletePathsRequest> for DeletePathsSvc<T> {
|
|
type Response = super::DeletePathsResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::DeletePathsRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::delete_paths(&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 = DeletePathsSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/UpdateMetadata" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct UpdateMetadataSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::UpdateMetadataRequest> for UpdateMetadataSvc<T> {
|
|
type Response = super::UpdateMetadataResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::UpdateMetadataRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::update_metadata(&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 = UpdateMetadataSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/WriteMetadata" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct WriteMetadataSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::WriteMetadataRequest> for WriteMetadataSvc<T> {
|
|
type Response = super::WriteMetadataResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::WriteMetadataRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::write_metadata(&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 = WriteMetadataSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ReadVersion" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReadVersionSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ReadVersionRequest> for ReadVersionSvc<T> {
|
|
type Response = super::ReadVersionResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ReadVersionRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::read_version(&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 = ReadVersionSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ReadXL" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReadXLSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ReadXlRequest> for ReadXLSvc<T> {
|
|
type Response = super::ReadXlResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ReadXlRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::read_xl(&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 = ReadXLSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/DeleteVersion" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct DeleteVersionSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::DeleteVersionRequest> for DeleteVersionSvc<T> {
|
|
type Response = super::DeleteVersionResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::DeleteVersionRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::delete_version(&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 = DeleteVersionSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/DeleteVersions" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct DeleteVersionsSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::DeleteVersionsRequest> for DeleteVersionsSvc<T> {
|
|
type Response = super::DeleteVersionsResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::DeleteVersionsRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::delete_versions(&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 = DeleteVersionsSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ReadMultiple" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReadMultipleSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::ReadMultipleRequest> for ReadMultipleSvc<T> {
|
|
type Response = super::ReadMultipleResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::ReadMultipleRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::read_multiple(&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 = ReadMultipleSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/DeleteVolume" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct DeleteVolumeSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::DeleteVolumeRequest> for DeleteVolumeSvc<T> {
|
|
type Response = super::DeleteVolumeResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::DeleteVolumeRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::delete_volume(&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 = DeleteVolumeSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/Lock" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct LockSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GenerallyLockRequest> for LockSvc<T> {
|
|
type Response = super::GenerallyLockResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GenerallyLockRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::lock(&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 = LockSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/UnLock" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct UnLockSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GenerallyLockRequest> for UnLockSvc<T> {
|
|
type Response = super::GenerallyLockResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GenerallyLockRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::un_lock(&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 = UnLockSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/RLock" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct RLockSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GenerallyLockRequest> for RLockSvc<T> {
|
|
type Response = super::GenerallyLockResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GenerallyLockRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::r_lock(&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 = RLockSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/RUnLock" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct RUnLockSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GenerallyLockRequest> for RUnLockSvc<T> {
|
|
type Response = super::GenerallyLockResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GenerallyLockRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::r_un_lock(&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 = RUnLockSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/ForceUnLock" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ForceUnLockSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GenerallyLockRequest> for ForceUnLockSvc<T> {
|
|
type Response = super::GenerallyLockResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GenerallyLockRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::force_un_lock(&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 = ForceUnLockSvc(inner);
|
|
let codec = tonic::codec::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)
|
|
}
|
|
"/node_service.NodeService/Refresh" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct RefreshSvc<T: NodeService>(pub Arc<T>);
|
|
impl<T: NodeService> tonic::server::UnaryService<super::GenerallyLockRequest> for RefreshSvc<T> {
|
|
type Response = super::GenerallyLockResponse;
|
|
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
|
|
fn call(&mut self, request: tonic::Request<super::GenerallyLockRequest>) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move { <T as NodeService>::refresh(&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 = RefreshSvc(inner);
|
|
let codec = tonic::codec::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(empty_body());
|
|
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 NodeServiceServer<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 = "node_service.NodeService";
|
|
impl<T> tonic::server::NamedService for NodeServiceServer<T> {
|
|
const NAME: &'static str = SERVICE_NAME;
|
|
}
|
|
}
|