#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseHeader {
#[prost(uint64, tag="1")]
pub cluster_id: u64,
#[prost(uint64, tag="2")]
pub member_id: u64,
#[prost(int64, tag="3")]
pub revision: i64,
#[prost(uint64, tag="4")]
pub raft_term: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RangeRequest {
#[prost(bytes="vec", tag="1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="2")]
pub range_end: ::prost::alloc::vec::Vec<u8>,
#[prost(int64, tag="3")]
pub limit: i64,
#[prost(int64, tag="4")]
pub revision: i64,
#[prost(enumeration="range_request::SortOrder", tag="5")]
pub sort_order: i32,
#[prost(enumeration="range_request::SortTarget", tag="6")]
pub sort_target: i32,
#[prost(bool, tag="7")]
pub serializable: bool,
#[prost(bool, tag="8")]
pub keys_only: bool,
#[prost(bool, tag="9")]
pub count_only: bool,
#[prost(int64, tag="10")]
pub min_mod_revision: i64,
#[prost(int64, tag="11")]
pub max_mod_revision: i64,
#[prost(int64, tag="12")]
pub min_create_revision: i64,
#[prost(int64, tag="13")]
pub max_create_revision: i64,
}
pub mod range_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SortOrder {
None = 0,
Ascend = 1,
Descend = 2,
}
impl SortOrder {
pub fn as_str_name(&self) -> &'static str {
match self {
SortOrder::None => "NONE",
SortOrder::Ascend => "ASCEND",
SortOrder::Descend => "DESCEND",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SortTarget {
Key = 0,
Version = 1,
Create = 2,
Mod = 3,
Value = 4,
}
impl SortTarget {
pub fn as_str_name(&self) -> &'static str {
match self {
SortTarget::Key => "KEY",
SortTarget::Version => "VERSION",
SortTarget::Create => "CREATE",
SortTarget::Mod => "MOD",
SortTarget::Value => "VALUE",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RangeResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub kvs: ::prost::alloc::vec::Vec<super::mvccpb::KeyValue>,
#[prost(bool, tag="3")]
pub more: bool,
#[prost(int64, tag="4")]
pub count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutRequest {
#[prost(bytes="vec", tag="1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(int64, tag="3")]
pub lease: i64,
#[prost(bool, tag="4")]
pub prev_kv: bool,
#[prost(bool, tag="5")]
pub ignore_value: bool,
#[prost(bool, tag="6")]
pub ignore_lease: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, optional, tag="2")]
pub prev_kv: ::core::option::Option<super::mvccpb::KeyValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRangeRequest {
#[prost(bytes="vec", tag="1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="2")]
pub range_end: ::prost::alloc::vec::Vec<u8>,
#[prost(bool, tag="3")]
pub prev_kv: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRangeResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(int64, tag="2")]
pub deleted: i64,
#[prost(message, repeated, tag="3")]
pub prev_kvs: ::prost::alloc::vec::Vec<super::mvccpb::KeyValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestOp {
#[prost(oneof="request_op::Request", tags="1, 2, 3, 4")]
pub request: ::core::option::Option<request_op::Request>,
}
pub mod request_op {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag="1")]
RequestRange(super::RangeRequest),
#[prost(message, tag="2")]
RequestPut(super::PutRequest),
#[prost(message, tag="3")]
RequestDeleteRange(super::DeleteRangeRequest),
#[prost(message, tag="4")]
RequestTxn(super::TxnRequest),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseOp {
#[prost(oneof="response_op::Response", tags="1, 2, 3, 4")]
pub response: ::core::option::Option<response_op::Response>,
}
pub mod response_op {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag="1")]
ResponseRange(super::RangeResponse),
#[prost(message, tag="2")]
ResponsePut(super::PutResponse),
#[prost(message, tag="3")]
ResponseDeleteRange(super::DeleteRangeResponse),
#[prost(message, tag="4")]
ResponseTxn(super::TxnResponse),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Compare {
#[prost(enumeration="compare::CompareResult", tag="1")]
pub result: i32,
#[prost(enumeration="compare::CompareTarget", tag="2")]
pub target: i32,
#[prost(bytes="vec", tag="3")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="64")]
pub range_end: ::prost::alloc::vec::Vec<u8>,
#[prost(oneof="compare::TargetUnion", tags="4, 5, 6, 7, 8")]
pub target_union: ::core::option::Option<compare::TargetUnion>,
}
pub mod compare {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompareResult {
Equal = 0,
Greater = 1,
Less = 2,
NotEqual = 3,
}
impl CompareResult {
pub fn as_str_name(&self) -> &'static str {
match self {
CompareResult::Equal => "EQUAL",
CompareResult::Greater => "GREATER",
CompareResult::Less => "LESS",
CompareResult::NotEqual => "NOT_EQUAL",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompareTarget {
Version = 0,
Create = 1,
Mod = 2,
Value = 3,
Lease = 4,
}
impl CompareTarget {
pub fn as_str_name(&self) -> &'static str {
match self {
CompareTarget::Version => "VERSION",
CompareTarget::Create => "CREATE",
CompareTarget::Mod => "MOD",
CompareTarget::Value => "VALUE",
CompareTarget::Lease => "LEASE",
}
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TargetUnion {
#[prost(int64, tag="4")]
Version(i64),
#[prost(int64, tag="5")]
CreateRevision(i64),
#[prost(int64, tag="6")]
ModRevision(i64),
#[prost(bytes, tag="7")]
Value(::prost::alloc::vec::Vec<u8>),
#[prost(int64, tag="8")]
Lease(i64),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxnRequest {
#[prost(message, repeated, tag="1")]
pub compare: ::prost::alloc::vec::Vec<Compare>,
#[prost(message, repeated, tag="2")]
pub success: ::prost::alloc::vec::Vec<RequestOp>,
#[prost(message, repeated, tag="3")]
pub failure: ::prost::alloc::vec::Vec<RequestOp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxnResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(bool, tag="2")]
pub succeeded: bool,
#[prost(message, repeated, tag="3")]
pub responses: ::prost::alloc::vec::Vec<ResponseOp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactionRequest {
#[prost(int64, tag="1")]
pub revision: i64,
#[prost(bool, tag="2")]
pub physical: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactionResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashKvRequest {
#[prost(int64, tag="1")]
pub revision: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashKvResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(uint32, tag="2")]
pub hash: u32,
#[prost(int64, tag="3")]
pub compact_revision: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(uint32, tag="2")]
pub hash: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(uint64, tag="2")]
pub remaining_bytes: u64,
#[prost(bytes="vec", tag="3")]
pub blob: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchRequest {
#[prost(oneof="watch_request::RequestUnion", tags="1, 2, 3")]
pub request_union: ::core::option::Option<watch_request::RequestUnion>,
}
pub mod watch_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum RequestUnion {
#[prost(message, tag="1")]
CreateRequest(super::WatchCreateRequest),
#[prost(message, tag="2")]
CancelRequest(super::WatchCancelRequest),
#[prost(message, tag="3")]
ProgressRequest(super::WatchProgressRequest),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchCreateRequest {
#[prost(bytes="vec", tag="1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="2")]
pub range_end: ::prost::alloc::vec::Vec<u8>,
#[prost(int64, tag="3")]
pub start_revision: i64,
#[prost(bool, tag="4")]
pub progress_notify: bool,
#[prost(enumeration="watch_create_request::FilterType", repeated, tag="5")]
pub filters: ::prost::alloc::vec::Vec<i32>,
#[prost(bool, tag="6")]
pub prev_kv: bool,
#[prost(int64, tag="7")]
pub watch_id: i64,
#[prost(bool, tag="8")]
pub fragment: bool,
}
pub mod watch_create_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FilterType {
Noput = 0,
Nodelete = 1,
}
impl FilterType {
pub fn as_str_name(&self) -> &'static str {
match self {
FilterType::Noput => "NOPUT",
FilterType::Nodelete => "NODELETE",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchCancelRequest {
#[prost(int64, tag="1")]
pub watch_id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchProgressRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(int64, tag="2")]
pub watch_id: i64,
#[prost(bool, tag="3")]
pub created: bool,
#[prost(bool, tag="4")]
pub canceled: bool,
#[prost(int64, tag="5")]
pub compact_revision: i64,
#[prost(string, tag="6")]
pub cancel_reason: ::prost::alloc::string::String,
#[prost(bool, tag="7")]
pub fragment: bool,
#[prost(message, repeated, tag="11")]
pub events: ::prost::alloc::vec::Vec<super::mvccpb::Event>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseGrantRequest {
#[prost(int64, tag="1")]
pub ttl: i64,
#[prost(int64, tag="2")]
pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseGrantResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(int64, tag="2")]
pub id: i64,
#[prost(int64, tag="3")]
pub ttl: i64,
#[prost(string, tag="4")]
pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseRevokeRequest {
#[prost(int64, tag="1")]
pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseRevokeResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseCheckpoint {
#[prost(int64, tag="1")]
pub id: i64,
#[prost(int64, tag="2")]
pub remaining_ttl: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseCheckpointRequest {
#[prost(message, repeated, tag="1")]
pub checkpoints: ::prost::alloc::vec::Vec<LeaseCheckpoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseCheckpointResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseKeepAliveRequest {
#[prost(int64, tag="1")]
pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseKeepAliveResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(int64, tag="2")]
pub id: i64,
#[prost(int64, tag="3")]
pub ttl: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseTimeToLiveRequest {
#[prost(int64, tag="1")]
pub id: i64,
#[prost(bool, tag="2")]
pub keys: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseTimeToLiveResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(int64, tag="2")]
pub id: i64,
#[prost(int64, tag="3")]
pub ttl: i64,
#[prost(int64, tag="4")]
pub granted_ttl: i64,
#[prost(bytes="vec", repeated, tag="5")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseLeasesRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseStatus {
#[prost(int64, tag="1")]
pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseLeasesResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub leases: ::prost::alloc::vec::Vec<LeaseStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Member {
#[prost(uint64, tag="1")]
pub id: u64,
#[prost(string, tag="2")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag="3")]
pub peer_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag="4")]
pub client_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag="5")]
pub is_learner: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberAddRequest {
#[prost(string, repeated, tag="1")]
pub peer_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag="2")]
pub is_learner: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberAddResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, optional, tag="2")]
pub member: ::core::option::Option<Member>,
#[prost(message, repeated, tag="3")]
pub members: ::prost::alloc::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberRemoveRequest {
#[prost(uint64, tag="1")]
pub id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberRemoveResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub members: ::prost::alloc::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberUpdateRequest {
#[prost(uint64, tag="1")]
pub id: u64,
#[prost(string, repeated, tag="2")]
pub peer_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberUpdateResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub members: ::prost::alloc::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberListRequest {
#[prost(bool, tag="1")]
pub linearizable: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberListResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub members: ::prost::alloc::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberPromoteRequest {
#[prost(uint64, tag="1")]
pub id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberPromoteResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub members: ::prost::alloc::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DefragmentRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DefragmentResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveLeaderRequest {
#[prost(uint64, tag="1")]
pub target_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveLeaderResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlarmRequest {
#[prost(enumeration="alarm_request::AlarmAction", tag="1")]
pub action: i32,
#[prost(uint64, tag="2")]
pub member_id: u64,
#[prost(enumeration="AlarmType", tag="3")]
pub alarm: i32,
}
pub mod alarm_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AlarmAction {
Get = 0,
Activate = 1,
Deactivate = 2,
}
impl AlarmAction {
pub fn as_str_name(&self) -> &'static str {
match self {
AlarmAction::Get => "GET",
AlarmAction::Activate => "ACTIVATE",
AlarmAction::Deactivate => "DEACTIVATE",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlarmMember {
#[prost(uint64, tag="1")]
pub member_id: u64,
#[prost(enumeration="AlarmType", tag="2")]
pub alarm: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlarmResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub alarms: ::prost::alloc::vec::Vec<AlarmMember>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DowngradeRequest {
#[prost(enumeration="downgrade_request::DowngradeAction", tag="1")]
pub action: i32,
#[prost(string, tag="2")]
pub version: ::prost::alloc::string::String,
}
pub mod downgrade_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DowngradeAction {
Validate = 0,
Enable = 1,
Cancel = 2,
}
impl DowngradeAction {
pub fn as_str_name(&self) -> &'static str {
match self {
DowngradeAction::Validate => "VALIDATE",
DowngradeAction::Enable => "ENABLE",
DowngradeAction::Cancel => "CANCEL",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DowngradeResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(string, tag="2")]
pub version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatusRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatusResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(string, tag="2")]
pub version: ::prost::alloc::string::String,
#[prost(int64, tag="3")]
pub db_size: i64,
#[prost(uint64, tag="4")]
pub leader: u64,
#[prost(uint64, tag="5")]
pub raft_index: u64,
#[prost(uint64, tag="6")]
pub raft_term: u64,
#[prost(uint64, tag="7")]
pub raft_applied_index: u64,
#[prost(string, repeated, tag="8")]
pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(int64, tag="9")]
pub db_size_in_use: i64,
#[prost(bool, tag="10")]
pub is_learner: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthEnableRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthDisableRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthStatusRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticateRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub password: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserAddRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub password: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub options: ::core::option::Option<super::authpb::UserAddOptions>,
#[prost(string, tag="4")]
pub hashed_password: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGetRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserDeleteRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserChangePasswordRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub password: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub hashed_password: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGrantRoleRequest {
#[prost(string, tag="1")]
pub user: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub role: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserRevokeRoleRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub role: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleAddRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGetRequest {
#[prost(string, tag="1")]
pub role: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserListRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleListRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleDeleteRequest {
#[prost(string, tag="1")]
pub role: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGrantPermissionRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub perm: ::core::option::Option<super::authpb::Permission>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleRevokePermissionRequest {
#[prost(string, tag="1")]
pub role: ::prost::alloc::string::String,
#[prost(bytes="vec", tag="2")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="3")]
pub range_end: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthEnableResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthDisableResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthStatusResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(bool, tag="2")]
pub enabled: bool,
#[prost(uint64, tag="3")]
pub auth_revision: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticateResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(string, tag="2")]
pub token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserAddResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGetResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(string, repeated, tag="2")]
pub roles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserDeleteResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserChangePasswordResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGrantRoleResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserRevokeRoleResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleAddResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGetResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(message, repeated, tag="2")]
pub perm: ::prost::alloc::vec::Vec<super::authpb::Permission>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleListResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(string, repeated, tag="2")]
pub roles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserListResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
#[prost(string, repeated, tag="2")]
pub users: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleDeleteResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGrantPermissionResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleRevokePermissionResponse {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<ResponseHeader>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AlarmType {
None = 0,
Nospace = 1,
Corrupt = 2,
}
impl AlarmType {
pub fn as_str_name(&self) -> &'static str {
match self {
AlarmType::None => "NONE",
AlarmType::Nospace => "NOSPACE",
AlarmType::Corrupt => "CORRUPT",
}
}
}
pub mod kv_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct KvClient<T> {
inner: tonic::client::Grpc<T>,
}
impl KvClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> KvClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> KvClient<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> + Send + Sync,
{
KvClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn range(
&mut self,
request: impl tonic::IntoRequest<super::RangeRequest>,
) -> Result<tonic::Response<super::RangeResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Range");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn put(
&mut self,
request: impl tonic::IntoRequest<super::PutRequest>,
) -> Result<tonic::Response<super::PutResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Put");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_range(
&mut self,
request: impl tonic::IntoRequest<super::DeleteRangeRequest>,
) -> Result<tonic::Response<super::DeleteRangeResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.KV/DeleteRange",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn txn(
&mut self,
request: impl tonic::IntoRequest<super::TxnRequest>,
) -> Result<tonic::Response<super::TxnResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Txn");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn compact(
&mut self,
request: impl tonic::IntoRequest<super::CompactionRequest>,
) -> Result<tonic::Response<super::CompactionResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Compact");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod watch_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct WatchClient<T> {
inner: tonic::client::Grpc<T>,
}
impl WatchClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> WatchClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> WatchClient<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> + Send + Sync,
{
WatchClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn watch(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::WatchRequest>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::WatchResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Watch/Watch");
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
}
}
pub mod lease_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct LeaseClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LeaseClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> LeaseClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> LeaseClient<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> + Send + Sync,
{
LeaseClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn lease_grant(
&mut self,
request: impl tonic::IntoRequest<super::LeaseGrantRequest>,
) -> Result<tonic::Response<super::LeaseGrantResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Lease/LeaseGrant",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn lease_revoke(
&mut self,
request: impl tonic::IntoRequest<super::LeaseRevokeRequest>,
) -> Result<tonic::Response<super::LeaseRevokeResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Lease/LeaseRevoke",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn lease_keep_alive(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::LeaseKeepAliveRequest,
>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::LeaseKeepAliveResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Lease/LeaseKeepAlive",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
pub async fn lease_time_to_live(
&mut self,
request: impl tonic::IntoRequest<super::LeaseTimeToLiveRequest>,
) -> Result<tonic::Response<super::LeaseTimeToLiveResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Lease/LeaseTimeToLive",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn lease_leases(
&mut self,
request: impl tonic::IntoRequest<super::LeaseLeasesRequest>,
) -> Result<tonic::Response<super::LeaseLeasesResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Lease/LeaseLeases",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod cluster_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ClusterClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ClusterClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ClusterClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> ClusterClient<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> + Send + Sync,
{
ClusterClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn member_add(
&mut self,
request: impl tonic::IntoRequest<super::MemberAddRequest>,
) -> Result<tonic::Response<super::MemberAddResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Cluster/MemberAdd",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn member_remove(
&mut self,
request: impl tonic::IntoRequest<super::MemberRemoveRequest>,
) -> Result<tonic::Response<super::MemberRemoveResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Cluster/MemberRemove",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn member_update(
&mut self,
request: impl tonic::IntoRequest<super::MemberUpdateRequest>,
) -> Result<tonic::Response<super::MemberUpdateResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Cluster/MemberUpdate",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn member_list(
&mut self,
request: impl tonic::IntoRequest<super::MemberListRequest>,
) -> Result<tonic::Response<super::MemberListResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Cluster/MemberList",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn member_promote(
&mut self,
request: impl tonic::IntoRequest<super::MemberPromoteRequest>,
) -> Result<tonic::Response<super::MemberPromoteResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Cluster/MemberPromote",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod maintenance_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MaintenanceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MaintenanceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MaintenanceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> MaintenanceClient<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> + Send + Sync,
{
MaintenanceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn alarm(
&mut self,
request: impl tonic::IntoRequest<super::AlarmRequest>,
) -> Result<tonic::Response<super::AlarmResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/Alarm",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn status(
&mut self,
request: impl tonic::IntoRequest<super::StatusRequest>,
) -> Result<tonic::Response<super::StatusResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/Status",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn defragment(
&mut self,
request: impl tonic::IntoRequest<super::DefragmentRequest>,
) -> Result<tonic::Response<super::DefragmentResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/Defragment",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn hash(
&mut self,
request: impl tonic::IntoRequest<super::HashRequest>,
) -> Result<tonic::Response<super::HashResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/Hash",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn hash_kv(
&mut self,
request: impl tonic::IntoRequest<super::HashKvRequest>,
) -> Result<tonic::Response<super::HashKvResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/HashKV",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn snapshot(
&mut self,
request: impl tonic::IntoRequest<super::SnapshotRequest>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::SnapshotResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/Snapshot",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
pub async fn move_leader(
&mut self,
request: impl tonic::IntoRequest<super::MoveLeaderRequest>,
) -> Result<tonic::Response<super::MoveLeaderResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/MoveLeader",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn downgrade(
&mut self,
request: impl tonic::IntoRequest<super::DowngradeRequest>,
) -> Result<tonic::Response<super::DowngradeResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Maintenance/Downgrade",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod auth_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct AuthClient<T> {
inner: tonic::client::Grpc<T>,
}
impl AuthClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> AuthClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> AuthClient<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> + Send + Sync,
{
AuthClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn auth_enable(
&mut self,
request: impl tonic::IntoRequest<super::AuthEnableRequest>,
) -> Result<tonic::Response<super::AuthEnableResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/AuthEnable",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn auth_disable(
&mut self,
request: impl tonic::IntoRequest<super::AuthDisableRequest>,
) -> Result<tonic::Response<super::AuthDisableResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/AuthDisable",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn auth_status(
&mut self,
request: impl tonic::IntoRequest<super::AuthStatusRequest>,
) -> Result<tonic::Response<super::AuthStatusResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/AuthStatus",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn authenticate(
&mut self,
request: impl tonic::IntoRequest<super::AuthenticateRequest>,
) -> Result<tonic::Response<super::AuthenticateResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/Authenticate",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_add(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserAddRequest>,
) -> Result<tonic::Response<super::AuthUserAddResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserAdd",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_get(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserGetRequest>,
) -> Result<tonic::Response<super::AuthUserGetResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserGet",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_list(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserListRequest>,
) -> Result<tonic::Response<super::AuthUserListResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserList",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_delete(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserDeleteRequest>,
) -> Result<tonic::Response<super::AuthUserDeleteResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserDelete",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_change_password(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserChangePasswordRequest>,
) -> Result<
tonic::Response<super::AuthUserChangePasswordResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserChangePassword",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_grant_role(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserGrantRoleRequest>,
) -> Result<tonic::Response<super::AuthUserGrantRoleResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserGrantRole",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn user_revoke_role(
&mut self,
request: impl tonic::IntoRequest<super::AuthUserRevokeRoleRequest>,
) -> Result<tonic::Response<super::AuthUserRevokeRoleResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/UserRevokeRole",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn role_add(
&mut self,
request: impl tonic::IntoRequest<super::AuthRoleAddRequest>,
) -> Result<tonic::Response<super::AuthRoleAddResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/RoleAdd",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn role_get(
&mut self,
request: impl tonic::IntoRequest<super::AuthRoleGetRequest>,
) -> Result<tonic::Response<super::AuthRoleGetResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/RoleGet",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn role_list(
&mut self,
request: impl tonic::IntoRequest<super::AuthRoleListRequest>,
) -> Result<tonic::Response<super::AuthRoleListResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/RoleList",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn role_delete(
&mut self,
request: impl tonic::IntoRequest<super::AuthRoleDeleteRequest>,
) -> Result<tonic::Response<super::AuthRoleDeleteResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/RoleDelete",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn role_grant_permission(
&mut self,
request: impl tonic::IntoRequest<super::AuthRoleGrantPermissionRequest>,
) -> Result<
tonic::Response<super::AuthRoleGrantPermissionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/RoleGrantPermission",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn role_revoke_permission(
&mut self,
request: impl tonic::IntoRequest<super::AuthRoleRevokePermissionRequest>,
) -> Result<
tonic::Response<super::AuthRoleRevokePermissionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/etcdserverpb.Auth/RoleRevokePermission",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}