#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Location {
#[prost(message, optional, tag = "1")]
pub region: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub zone: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub campus: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchString {
#[prost(enumeration = "match_string::MatchStringType", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "match_string::ValueType", tag = "3")]
pub value_type: i32,
}
pub mod match_string {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum MatchStringType {
Exact = 0,
Regex = 1,
NotEquals = 2,
In = 3,
NotIn = 4,
Range = 5,
}
impl MatchStringType {
pub fn as_str_name(&self) -> &'static str {
match self {
MatchStringType::Exact => "EXACT",
MatchStringType::Regex => "REGEX",
MatchStringType::NotEquals => "NOT_EQUALS",
MatchStringType::In => "IN",
MatchStringType::NotIn => "NOT_IN",
MatchStringType::Range => "RANGE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXACT" => Some(Self::Exact),
"REGEX" => Some(Self::Regex),
"NOT_EQUALS" => Some(Self::NotEquals),
"IN" => Some(Self::In),
"NOT_IN" => Some(Self::NotIn),
"RANGE" => Some(Self::Range),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ValueType {
Text = 0,
Parameter = 1,
Variable = 2,
}
impl ValueType {
pub fn as_str_name(&self) -> &'static str {
match self {
ValueType::Text => "TEXT",
ValueType::Parameter => "PARAMETER",
ValueType::Variable => "VARIABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TEXT" => Some(Self::Text),
"PARAMETER" => Some(Self::Parameter),
"VARIABLE" => Some(Self::Variable),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringList {
#[prost(string, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Summary {
#[prost(uint32, tag = "1")]
pub total_service_count: u32,
#[prost(uint32, tag = "2")]
pub total_health_instance_count: u32,
#[prost(uint32, tag = "3")]
pub total_instance_count: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientLabel {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<MatchString>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Api {
#[prost(string, tag = "1")]
pub protocol: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub method: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub path: ::core::option::Option<MatchString>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CircuitBreaker {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub version: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub service_namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "7")]
pub inbounds: ::prost::alloc::vec::Vec<CbRule>,
#[prost(message, repeated, tag = "8")]
pub outbounds: ::prost::alloc::vec::Vec<CbRule>,
#[prost(message, optional, tag = "9")]
pub token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub owners: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub business: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub department: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "13")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "14")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "21")]
pub rules: ::prost::alloc::vec::Vec<CircuitBreakerRule>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceMatcher {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "3")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecoverConfig {
#[prost(message, optional, tag = "1")]
pub sleep_window: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "2")]
pub max_retry_after_half_open: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "3")]
pub request_rate_after_half_open: ::prost::alloc::vec::Vec<u32>,
#[prost(message, optional, tag = "4")]
pub success_rate_to_close: ::core::option::Option<u32>,
#[prost(message, optional, tag = "5")]
pub request_count_after_half_open: ::core::option::Option<u32>,
#[prost(enumeration = "recover_config::OutlierDetectWhen", tag = "6")]
pub outlier_detect_when: i32,
}
pub mod recover_config {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OutlierDetectWhen {
Never = 0,
OnRecover = 1,
Always = 2,
}
impl OutlierDetectWhen {
pub fn as_str_name(&self) -> &'static str {
match self {
OutlierDetectWhen::Never => "NEVER",
OutlierDetectWhen::OnRecover => "ON_RECOVER",
OutlierDetectWhen::Always => "ALWAYS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NEVER" => Some(Self::Never),
"ON_RECOVER" => Some(Self::OnRecover),
"ALWAYS" => Some(Self::Always),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CbPolicy {
#[prost(message, optional, tag = "1")]
pub error_rate: ::core::option::Option<cb_policy::ErrRateConfig>,
#[prost(message, optional, tag = "2")]
pub slow_rate: ::core::option::Option<cb_policy::SlowRateConfig>,
#[prost(message, optional, tag = "3")]
pub judge_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "4")]
pub max_ejection_percent: ::core::option::Option<u32>,
#[prost(message, optional, tag = "5")]
pub consecutive: ::core::option::Option<cb_policy::ConsecutiveErrConfig>,
}
pub mod cb_policy {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrRateConfig {
#[prost(message, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub request_volume_threshold: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub error_rate_to_preserved: ::core::option::Option<u32>,
#[prost(message, optional, tag = "4")]
pub error_rate_to_open: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "5")]
pub specials: ::prost::alloc::vec::Vec<err_rate_config::SpecialConfig>,
}
pub mod err_rate_config {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpecialConfig {
#[prost(message, optional, tag = "1")]
pub r#type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub error_codes: ::prost::alloc::vec::Vec<i64>,
#[prost(message, optional, tag = "3")]
pub error_rate_to_preserved: ::core::option::Option<u32>,
#[prost(message, optional, tag = "4")]
pub error_rate_to_open: ::core::option::Option<u32>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SlowRateConfig {
#[prost(message, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub max_rt: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "3")]
pub slow_rate_to_preserved: ::core::option::Option<u32>,
#[prost(message, optional, tag = "4")]
pub slow_rate_to_open: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsecutiveErrConfig {
#[prost(message, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub consecutive_error_to_preserved: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub consecutive_error_to_open: ::core::option::Option<u32>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DestinationSet {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
MatchString,
>,
#[prost(enumeration = "destination_set::Resource", tag = "4")]
pub resource: i32,
#[prost(enumeration = "destination_set::Type", tag = "5")]
pub r#type: i32,
#[prost(enumeration = "destination_set::Scope", tag = "6")]
pub scope: i32,
#[prost(message, optional, tag = "7")]
pub metric_window: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "8")]
pub metric_precision: ::core::option::Option<u32>,
#[prost(message, optional, tag = "9")]
pub update_interval: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "10")]
pub recover: ::core::option::Option<RecoverConfig>,
#[prost(message, optional, tag = "11")]
pub policy: ::core::option::Option<CbPolicy>,
#[prost(message, optional, tag = "12")]
pub method: ::core::option::Option<MatchString>,
#[prost(message, repeated, tag = "13")]
pub error_codes: ::prost::alloc::vec::Vec<i64>,
}
pub mod destination_set {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Resource {
Subset = 0,
Instance = 1,
}
impl Resource {
pub fn as_str_name(&self) -> &'static str {
match self {
Resource::Subset => "SUBSET",
Resource::Instance => "INSTANCE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SUBSET" => Some(Self::Subset),
"INSTANCE" => Some(Self::Instance),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Global = 0,
Local = 1,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Global => "GLOBAL",
Type::Local => "LOCAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"GLOBAL" => Some(Self::Global),
"LOCAL" => Some(Self::Local),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Scope {
All = 0,
Current = 1,
}
impl Scope {
pub fn as_str_name(&self) -> &'static str {
match self {
Scope::All => "ALL",
Scope::Current => "CURRENT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALL" => Some(Self::All),
"CURRENT" => Some(Self::Current),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CbRule {
#[prost(message, repeated, tag = "1")]
pub sources: ::prost::alloc::vec::Vec<SourceMatcher>,
#[prost(message, repeated, tag = "2")]
pub destinations: ::prost::alloc::vec::Vec<DestinationSet>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleMatcher {
#[prost(message, optional, tag = "1")]
pub source: ::core::option::Option<rule_matcher::SourceService>,
#[prost(message, optional, tag = "2")]
pub destination: ::core::option::Option<rule_matcher::DestinationService>,
}
pub mod rule_matcher {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceService {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DestinationService {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[deprecated]
#[prost(message, optional, tag = "3")]
pub method: ::core::option::Option<super::MatchString>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CircuitBreakerRule {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub enable: bool,
#[prost(string, tag = "5")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub etime: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub description: ::prost::alloc::string::String,
#[prost(enumeration = "Level", tag = "21")]
pub level: i32,
#[prost(message, optional, tag = "22")]
pub rule_matcher: ::core::option::Option<RuleMatcher>,
#[deprecated]
#[prost(message, repeated, tag = "23")]
pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
#[deprecated]
#[prost(message, repeated, tag = "24")]
pub trigger_condition: ::prost::alloc::vec::Vec<TriggerCondition>,
#[prost(uint32, tag = "25")]
pub max_ejection_percent: u32,
#[prost(message, optional, tag = "26")]
pub recover_condition: ::core::option::Option<RecoverCondition>,
#[prost(message, optional, tag = "27")]
pub fault_detect_config: ::core::option::Option<FaultDetectConfig>,
#[prost(message, optional, tag = "28")]
pub fallback_config: ::core::option::Option<FallbackConfig>,
#[prost(message, repeated, tag = "29")]
pub block_configs: ::prost::alloc::vec::Vec<BlockConfig>,
#[prost(uint32, tag = "30")]
pub priority: u32,
#[prost(map = "string, string", tag = "31")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "40")]
pub editable: bool,
#[prost(bool, tag = "41")]
pub deleteable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorCondition {
#[prost(enumeration = "error_condition::InputType", tag = "1")]
pub input_type: i32,
#[prost(message, optional, tag = "2")]
pub condition: ::core::option::Option<MatchString>,
}
pub mod error_condition {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InputType {
Unknown = 0,
RetCode = 1,
Delay = 2,
}
impl InputType {
pub fn as_str_name(&self) -> &'static str {
match self {
InputType::Unknown => "UNKNOWN",
InputType::RetCode => "RET_CODE",
InputType::Delay => "DELAY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"RET_CODE" => Some(Self::RetCode),
"DELAY" => Some(Self::Delay),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TriggerCondition {
#[prost(enumeration = "trigger_condition::TriggerType", tag = "1")]
pub trigger_type: i32,
#[prost(uint32, tag = "2")]
pub error_count: u32,
#[prost(uint32, tag = "3")]
pub error_percent: u32,
#[prost(uint32, tag = "4")]
pub interval: u32,
#[prost(uint32, tag = "5")]
pub minimum_request: u32,
}
pub mod trigger_condition {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TriggerType {
Unknown = 0,
ErrorRate = 1,
ConsecutiveError = 2,
}
impl TriggerType {
pub fn as_str_name(&self) -> &'static str {
match self {
TriggerType::Unknown => "UNKNOWN",
TriggerType::ErrorRate => "ERROR_RATE",
TriggerType::ConsecutiveError => "CONSECUTIVE_ERROR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"ERROR_RATE" => Some(Self::ErrorRate),
"CONSECUTIVE_ERROR" => Some(Self::ConsecutiveError),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecoverCondition {
#[prost(uint32, tag = "1")]
pub sleep_window: u32,
#[prost(uint32, tag = "2")]
pub consecutive_success: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FaultDetectConfig {
#[prost(bool, tag = "1")]
pub enable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockConfig {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub api: ::core::option::Option<Api>,
#[prost(message, repeated, tag = "3")]
pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
#[prost(message, repeated, tag = "4")]
pub trigger_conditions: ::prost::alloc::vec::Vec<TriggerCondition>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FallbackConfig {
#[prost(bool, tag = "1")]
pub enable: bool,
#[prost(message, optional, tag = "2")]
pub response: ::core::option::Option<FallbackResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FallbackResponse {
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(message, repeated, tag = "2")]
pub headers: ::prost::alloc::vec::Vec<fallback_response::MessageHeader>,
#[prost(string, tag = "3")]
pub body: ::prost::alloc::string::String,
}
pub mod fallback_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageHeader {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Level {
Unknown = 0,
Service = 1,
Method = 2,
Group = 3,
Instance = 4,
}
impl Level {
pub fn as_str_name(&self) -> &'static str {
match self {
Level::Unknown => "UNKNOWN",
Level::Service => "SERVICE",
Level::Method => "METHOD",
Level::Group => "GROUP",
Level::Instance => "INSTANCE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SERVICE" => Some(Self::Service),
"METHOD" => Some(Self::Method),
"GROUP" => Some(Self::Group),
"INSTANCE" => Some(Self::Instance),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileGroup {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub create_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub file_count: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "10")]
pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "11")]
pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "13")]
pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "14")]
pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub editable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "16")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "17")]
pub business: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "18")]
pub department: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "19")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "20")]
pub deleteable: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFile {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub group: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub content: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub format: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub status: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "9")]
pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
#[prost(message, optional, tag = "10")]
pub create_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub create_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "13")]
pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "14")]
pub release_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub release_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub encrypted: ::core::option::Option<bool>,
#[prost(message, optional, tag = "17")]
pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileTag {
#[prost(message, optional, tag = "1")]
pub key: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileRelease {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub group: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub file_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub content: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub md5: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub version: ::core::option::Option<u64>,
#[prost(message, optional, tag = "10")]
pub create_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub create_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "13")]
pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "14")]
pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
#[prost(message, optional, tag = "15")]
pub active: ::core::option::Option<bool>,
#[prost(message, optional, tag = "16")]
pub format: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "17")]
pub release_description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "18")]
pub release_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "19")]
pub beta_labels: ::prost::alloc::vec::Vec<ClientLabel>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileReleaseHistory {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub group: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub file_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub content: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub format: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub md5: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub r#type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub status: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "12")]
pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
#[prost(message, optional, tag = "13")]
pub create_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "14")]
pub create_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "17")]
pub reason: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "18")]
pub release_description: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileTemplate {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub content: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub format: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub create_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub modify_time: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientConfigFileInfo {
#[prost(message, optional, tag = "1")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub group: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub file_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub content: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub version: ::core::option::Option<u64>,
#[prost(message, optional, tag = "6")]
pub md5: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "7")]
pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
#[prost(message, optional, tag = "8")]
pub encrypted: ::core::option::Option<bool>,
#[prost(message, optional, tag = "9")]
pub public_key: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub release_time: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientWatchConfigFileRequest {
#[prost(message, optional, tag = "1")]
pub client_ip: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub service_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub watch_files: ::prost::alloc::vec::Vec<ClientConfigFileInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileExportRequest {
#[prost(message, optional, tag = "1")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFilePublishInfo {
#[prost(message, optional, tag = "1")]
pub release_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub group: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub file_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub content: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub format: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub release_description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub create_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "13")]
pub modify_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "14")]
pub tags: ::prost::alloc::vec::Vec<ConfigFileTag>,
#[prost(message, optional, tag = "15")]
pub md5: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub encrypted: ::core::option::Option<bool>,
#[prost(message, optional, tag = "17")]
pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigFileGroupRequest {
#[prost(message, optional, tag = "1")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub config_file_group: ::core::option::Option<ConfigFileGroup>,
#[prost(map = "string, string", tag = "12")]
pub client_labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigDiscoverRequest {
#[prost(
enumeration = "config_discover_request::ConfigDiscoverRequestType",
tag = "1"
)]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub config_file: ::core::option::Option<ClientConfigFileInfo>,
#[prost(string, tag = "3")]
pub revision: ::prost::alloc::string::String,
}
pub mod config_discover_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ConfigDiscoverRequestType {
Unknown = 0,
ConfigFile = 1,
ConfigFileNames = 2,
ConfigFileGroups = 3,
}
impl ConfigDiscoverRequestType {
pub fn as_str_name(&self) -> &'static str {
match self {
ConfigDiscoverRequestType::Unknown => "UNKNOWN",
ConfigDiscoverRequestType::ConfigFile => "CONFIG_FILE",
ConfigDiscoverRequestType::ConfigFileNames => "CONFIG_FILE_Names",
ConfigDiscoverRequestType::ConfigFileGroups => "CONFIG_FILE_GROUPS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"CONFIG_FILE" => Some(Self::ConfigFile),
"CONFIG_FILE_Names" => Some(Self::ConfigFileNames),
"CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigDiscoverResponse {
#[prost(uint32, tag = "1")]
pub code: u32,
#[prost(string, tag = "2")]
pub info: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub revision: ::prost::alloc::string::String,
#[prost(
enumeration = "config_discover_response::ConfigDiscoverResponseType",
tag = "4"
)]
pub r#type: i32,
#[prost(message, optional, tag = "5")]
pub config_file: ::core::option::Option<ClientConfigFileInfo>,
#[prost(message, repeated, tag = "6")]
pub config_file_names: ::prost::alloc::vec::Vec<ClientConfigFileInfo>,
#[prost(message, repeated, tag = "7")]
pub config_file_groups: ::prost::alloc::vec::Vec<ConfigFileGroup>,
}
pub mod config_discover_response {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ConfigDiscoverResponseType {
Unknown = 0,
ConfigFile = 1,
ConfigFileNames = 2,
ConfigFileGroups = 3,
}
impl ConfigDiscoverResponseType {
pub fn as_str_name(&self) -> &'static str {
match self {
ConfigDiscoverResponseType::Unknown => "UNKNOWN",
ConfigDiscoverResponseType::ConfigFile => "CONFIG_FILE",
ConfigDiscoverResponseType::ConfigFileNames => "CONFIG_FILE_Names",
ConfigDiscoverResponseType::ConfigFileGroups => "CONFIG_FILE_GROUPS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"CONFIG_FILE" => Some(Self::ConfigFile),
"CONFIG_FILE_Names" => Some(Self::ConfigFileNames),
"CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigSimpleResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub config_file_group: ::core::option::Option<ConfigFileGroup>,
#[prost(message, optional, tag = "4")]
pub config_file: ::core::option::Option<ConfigFile>,
#[prost(message, optional, tag = "5")]
pub config_file_release: ::core::option::Option<ConfigFileRelease>,
#[prost(message, optional, tag = "6")]
pub config_file_release_history: ::core::option::Option<ConfigFileReleaseHistory>,
#[prost(message, optional, tag = "7")]
pub config_file_template: ::core::option::Option<ConfigFileTemplate>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigBatchWriteResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub total: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "4")]
pub responses: ::prost::alloc::vec::Vec<ConfigResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigBatchQueryResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub total: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "4")]
pub config_file_groups: ::prost::alloc::vec::Vec<ConfigFileGroup>,
#[prost(message, repeated, tag = "5")]
pub config_files: ::prost::alloc::vec::Vec<ConfigFile>,
#[prost(message, repeated, tag = "6")]
pub config_file_releases: ::prost::alloc::vec::Vec<ConfigFileRelease>,
#[prost(message, repeated, tag = "7")]
pub config_file_release_histories: ::prost::alloc::vec::Vec<
ConfigFileReleaseHistory,
>,
#[prost(message, repeated, tag = "8")]
pub config_file_templates: ::prost::alloc::vec::Vec<ConfigFileTemplate>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigClientResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub config_file: ::core::option::Option<ClientConfigFileInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigImportResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub create_config_files: ::prost::alloc::vec::Vec<ConfigFile>,
#[prost(message, repeated, tag = "4")]
pub skip_config_files: ::prost::alloc::vec::Vec<ConfigFile>,
#[prost(message, repeated, tag = "5")]
pub overwrite_config_files: ::prost::alloc::vec::Vec<ConfigFile>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigExportResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigEncryptAlgorithmResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigClientListResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "4")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub group: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub config_file_infos: ::prost::alloc::vec::Vec<ClientConfigFileInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Routing {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub inbounds: ::prost::alloc::vec::Vec<Route>,
#[prost(message, repeated, tag = "4")]
pub outbounds: ::prost::alloc::vec::Vec<Route>,
#[prost(message, optional, tag = "5")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub service_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "21")]
pub rules: ::prost::alloc::vec::Vec<RouteRule>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Route {
#[prost(message, repeated, tag = "1")]
pub sources: ::prost::alloc::vec::Vec<Source>,
#[prost(message, repeated, tag = "2")]
pub destinations: ::prost::alloc::vec::Vec<Destination>,
#[prost(map = "string, string", tag = "3")]
pub extend_info: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Source {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
MatchString,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Destination {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
MatchString,
>,
#[prost(message, optional, tag = "4")]
pub priority: ::core::option::Option<u32>,
#[prost(message, optional, tag = "5")]
pub weight: ::core::option::Option<u32>,
#[prost(message, optional, tag = "6")]
pub transfer: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub isolate: ::core::option::Option<bool>,
#[prost(message, optional, tag = "8")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteRule {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub enable: bool,
#[prost(enumeration = "RoutingPolicy", tag = "5")]
pub routing_policy: i32,
#[prost(message, optional, tag = "6")]
pub routing_config: ::core::option::Option<::prost_types::Any>,
#[prost(string, tag = "7")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub etime: ::prost::alloc::string::String,
#[prost(uint32, tag = "11")]
pub priority: u32,
#[prost(string, tag = "12")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "20")]
pub extend_info: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "21")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "30")]
pub editable: bool,
#[prost(bool, tag = "31")]
pub deleteable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetadataFailover {
#[prost(enumeration = "metadata_failover::FailoverRange", tag = "1")]
pub failover_range: i32,
#[prost(map = "string, string", tag = "2")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
pub mod metadata_failover {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum FailoverRange {
All = 0,
Others = 1,
OtherKeys = 2,
}
impl FailoverRange {
pub fn as_str_name(&self) -> &'static str {
match self {
FailoverRange::All => "ALL",
FailoverRange::Others => "OTHERS",
FailoverRange::OtherKeys => "OTHER_KEYS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALL" => Some(Self::All),
"OTHERS" => Some(Self::Others),
"OTHER_KEYS" => Some(Self::OtherKeys),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetadataRoutingConfig {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "4")]
pub failover: ::core::option::Option<MetadataFailover>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NearbyRoutingConfig {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "3")]
pub match_level: i32,
#[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "4")]
pub max_match_level: i32,
#[prost(bool, tag = "5")]
pub strict_nearby: bool,
}
pub mod nearby_routing_config {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum LocationLevel {
Unknown = 0,
Campus = 1,
Zone = 2,
Region = 3,
All = 4,
}
impl LocationLevel {
pub fn as_str_name(&self) -> &'static str {
match self {
LocationLevel::Unknown => "UNKNOWN",
LocationLevel::Campus => "CAMPUS",
LocationLevel::Zone => "ZONE",
LocationLevel::Region => "REGION",
LocationLevel::All => "ALL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"CAMPUS" => Some(Self::Campus),
"ZONE" => Some(Self::Zone),
"REGION" => Some(Self::Region),
"ALL" => Some(Self::All),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleRoutingConfig {
#[deprecated]
#[prost(message, repeated, tag = "1")]
pub sources: ::prost::alloc::vec::Vec<SourceService>,
#[deprecated]
#[prost(message, repeated, tag = "2")]
pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
#[prost(message, repeated, tag = "3")]
pub rules: ::prost::alloc::vec::Vec<SubRuleRouting>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubRuleRouting {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub sources: ::prost::alloc::vec::Vec<SourceService>,
#[prost(message, repeated, tag = "3")]
pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceService {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub arguments: ::prost::alloc::vec::Vec<SourceMatch>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DestinationGroup {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "3")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
#[prost(uint32, tag = "4")]
pub priority: u32,
#[prost(uint32, tag = "5")]
pub weight: u32,
#[prost(string, tag = "6")]
pub transfer: ::prost::alloc::string::String,
#[prost(bool, tag = "7")]
pub isolate: bool,
#[prost(string, tag = "8")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceMatch {
#[prost(enumeration = "source_match::Type", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub value: ::core::option::Option<MatchString>,
}
pub mod source_match {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Custom = 0,
Method = 1,
Header = 2,
Query = 3,
CallerIp = 4,
Path = 5,
Cookie = 6,
CallerMetadata = 7,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Custom => "CUSTOM",
Type::Method => "METHOD",
Type::Header => "HEADER",
Type::Query => "QUERY",
Type::CallerIp => "CALLER_IP",
Type::Path => "PATH",
Type::Cookie => "COOKIE",
Type::CallerMetadata => "CALLER_METADATA",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CUSTOM" => Some(Self::Custom),
"METHOD" => Some(Self::Method),
"HEADER" => Some(Self::Header),
"QUERY" => Some(Self::Query),
"CALLER_IP" => Some(Self::CallerIp),
"PATH" => Some(Self::Path),
"COOKIE" => Some(Self::Cookie),
"CALLER_METADATA" => Some(Self::CallerMetadata),
_ => None,
}
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RoutingPolicy {
RulePolicy = 0,
MetadataPolicy = 1,
NearbyPolicy = 2,
}
impl RoutingPolicy {
pub fn as_str_name(&self) -> &'static str {
match self {
RoutingPolicy::RulePolicy => "RulePolicy",
RoutingPolicy::MetadataPolicy => "MetadataPolicy",
RoutingPolicy::NearbyPolicy => "NearbyPolicy",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RulePolicy" => Some(Self::RulePolicy),
"MetadataPolicy" => Some(Self::MetadataPolicy),
"NearbyPolicy" => Some(Self::NearbyPolicy),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Code {
Unknown = 0,
ExecuteSuccess = 200000,
DataNoChange = 200001,
NoNeedUpdate = 200002,
BadRequest = 400000,
ParseException = 400001,
EmptyRequest = 400002,
BatchSizeOverLimit = 400003,
InvalidDiscoverResource = 400004,
InvalidRequestId = 400100,
InvalidUserName = 400101,
InvalidUserToken = 400102,
InvalidParameter = 400103,
EmptyQueryParameter = 400104,
InvalidQueryInsParameter = 400105,
InvalidNamespaceName = 400110,
InvalidNamespaceOwners = 400111,
InvalidNamespaceToken = 400112,
InvalidServiceName = 400120,
InvalidServiceOwners = 400121,
InvalidServiceToken = 400122,
InvalidServiceMetadata = 400123,
InvalidServicePorts = 400124,
InvalidServiceBusiness = 400125,
InvalidServiceDepartment = 400126,
InvalidServiceCmdb = 400127,
InvalidServiceComment = 400128,
InvalidServiceAliasComment = 400129,
InvalidInstanceId = 400130,
InvalidInstanceHost = 400131,
InvalidInstancePort = 400132,
InvalidServiceAlias = 400133,
InvalidNamespaceWithAlias = 400134,
InvalidServiceAliasOwners = 400135,
InvalidInstanceProtocol = 400136,
InvalidInstanceVersion = 400137,
InvalidInstanceLogicSet = 400138,
InvalidInstanceIsolate = 400139,
HealthCheckNotOpen = 400140,
HeartbeatOnDisabledIns = 400141,
HeartbeatExceedLimit = 400142,
HeartbeatTypeNotFound = 400143,
InvalidMetadata = 400150,
InvalidRateLimitId = 400151,
InvalidRateLimitLabels = 400152,
InvalidRateLimitAmounts = 400153,
InvalidRateLimitName = 400154,
InvalidCircuitBreakerId = 400160,
InvalidCircuitBreakerVersion = 400161,
InvalidCircuitBreakerName = 400162,
InvalidCircuitBreakerNamespace = 400163,
InvalidCircuitBreakerOwners = 400164,
InvalidCircuitBreakerToken = 400165,
InvalidCircuitBreakerBusiness = 400166,
InvalidCircuitBreakerDepartment = 400167,
InvalidCircuitBreakerComment = 400168,
CircuitBreakerRuleExisted = 400169,
InvalidRoutingId = 400700,
InvalidRoutingPolicy = 400701,
InvalidRoutingName = 400702,
InvalidRoutingPriority = 400703,
InvalidFaultDetectId = 400900,
InvalidFaultDetectName = 400901,
InvalidFaultDetectNamespace = 400902,
FaultDetectRuleExisted = 400903,
InvalidMatchRule = 400904,
ServicesExistedMesh = 400170,
ResourcesExistedMesh = 400171,
InvalidMeshParameter = 400172,
InvalidPlatformId = 400180,
InvalidPlatformName = 400181,
InvalidPlatformDomain = 400182,
InvalidPlatformQps = 400183,
InvalidPlatformToken = 400184,
InvalidPlatformOwner = 400185,
InvalidPlatformDepartment = 400186,
InvalidPlatformComment = 400187,
NotFoundPlatform = 400188,
InvalidFluxRateLimitId = 400190,
InvalidFluxRateLimitQps = 400191,
InvalidFluxRateLimitSetKey = 400192,
ExistedResource = 400201,
NotFoundResource = 400202,
NamespaceExistedServices = 400203,
ServiceExistedInstances = 400204,
ServiceExistedRoutings = 400205,
ServiceExistedRateLimits = 400206,
ExistReleasedConfig = 400207,
SameInstanceRequest = 400208,
ServiceExistedCircuitBreakers = 400209,
ServiceExistedAlias = 400210,
NamespaceExistedMeshResources = 400211,
NamespaceExistedCircuitBreakers = 400212,
ServiceSubscribedByMeshes = 400213,
ServiceExistedFluxRateLimits = 400214,
NamespaceExistedConfigGroups = 400219,
NotFoundService = 400301,
NotFoundRouting = 400302,
NotFoundInstance = 400303,
NotFoundServiceAlias = 400304,
NotFoundNamespace = 400305,
NotFoundSourceService = 400306,
NotFoundRateLimit = 400307,
NotFoundCircuitBreaker = 400308,
NotFoundMasterConfig = 400309,
NotFoundTagConfig = 400310,
NotFoundTagConfigOrService = 400311,
ClientApiNotOpen = 400401,
NotAllowBusinessService = 400402,
NotAllowAliasUpdate = 400501,
NotAllowAliasCreateInstance = 400502,
NotAllowAliasCreateRouting = 400503,
NotAllowCreateAliasForAlias = 400504,
NotAllowAliasCreateRateLimit = 400505,
NotAllowAliasBindRule = 400506,
NotAllowDifferentNamespaceBindRule = 400507,
Unauthorized = 401000,
NotAllowedAccess = 401001,
CmdbNotFindHost = 404001,
DataConflict = 409000,
InstanceTooManyRequests = 429001,
IpRateLimit = 429002,
ApiRateLimit = 403003,
ExecuteException = 500000,
StoreLayerException = 500001,
CmdbPluginException = 500002,
ParseRoutingException = 500004,
ParseRateLimitException = 500005,
ParseCircuitBreakerException = 500006,
HeartbeatException = 500007,
InstanceRegisTimeout = 500008,
InvalidConfigFileGroupName = 400801,
InvalidConfigFileName = 400802,
InvalidConfigFileContentLength = 400803,
InvalidConfigFileFormat = 400804,
InvalidConfigFileTags = 400805,
InvalidWatchConfigFileFormat = 400806,
NotFoundResourceConfigFile = 400807,
InvalidConfigFileTemplateName = 400808,
EncryptConfigFileException = 400809,
GroupExistActiveRelease = 400810,
DecryptConfigFileException = 400811,
InvalidUserOwners = 400410,
InvalidUserId = 400411,
InvalidUserPassword = 400412,
InvalidUserMobile = 400413,
InvalidUserEmail = 400414,
InvalidUserGroupOwners = 400420,
InvalidUserGroupId = 400421,
InvalidAuthStrategyOwners = 400430,
InvalidAuthStrategyName = 400431,
InvalidAuthStrategyId = 400432,
InvalidPrincipalType = 400440,
UserExisted = 400215,
UserGroupExisted = 400216,
AuthStrategyRuleExisted = 400217,
SubAccountExisted = 400218,
NotFoundUser = 400312,
NotFoundOwnerUser = 400313,
NotFoundUserGroup = 400314,
NotFoundAuthStrategyRule = 400315,
NotAllowModifyDefaultStrategyPrincipal = 400508,
NotAllowModifyOwnerDefaultStrategy = 400509,
EmptyAutToken = 401002,
TokenDisabled = 401003,
TokenNotExisted = 401004,
AuthTokenForbidden = 403001,
OperationRoleForbidden = 403002,
}
impl Code {
pub fn as_str_name(&self) -> &'static str {
match self {
Code::Unknown => "Unknown",
Code::ExecuteSuccess => "ExecuteSuccess",
Code::DataNoChange => "DataNoChange",
Code::NoNeedUpdate => "NoNeedUpdate",
Code::BadRequest => "BadRequest",
Code::ParseException => "ParseException",
Code::EmptyRequest => "EmptyRequest",
Code::BatchSizeOverLimit => "BatchSizeOverLimit",
Code::InvalidDiscoverResource => "InvalidDiscoverResource",
Code::InvalidRequestId => "InvalidRequestID",
Code::InvalidUserName => "InvalidUserName",
Code::InvalidUserToken => "InvalidUserToken",
Code::InvalidParameter => "InvalidParameter",
Code::EmptyQueryParameter => "EmptyQueryParameter",
Code::InvalidQueryInsParameter => "InvalidQueryInsParameter",
Code::InvalidNamespaceName => "InvalidNamespaceName",
Code::InvalidNamespaceOwners => "InvalidNamespaceOwners",
Code::InvalidNamespaceToken => "InvalidNamespaceToken",
Code::InvalidServiceName => "InvalidServiceName",
Code::InvalidServiceOwners => "InvalidServiceOwners",
Code::InvalidServiceToken => "InvalidServiceToken",
Code::InvalidServiceMetadata => "InvalidServiceMetadata",
Code::InvalidServicePorts => "InvalidServicePorts",
Code::InvalidServiceBusiness => "InvalidServiceBusiness",
Code::InvalidServiceDepartment => "InvalidServiceDepartment",
Code::InvalidServiceCmdb => "InvalidServiceCMDB",
Code::InvalidServiceComment => "InvalidServiceComment",
Code::InvalidServiceAliasComment => "InvalidServiceAliasComment",
Code::InvalidInstanceId => "InvalidInstanceID",
Code::InvalidInstanceHost => "InvalidInstanceHost",
Code::InvalidInstancePort => "InvalidInstancePort",
Code::InvalidServiceAlias => "InvalidServiceAlias",
Code::InvalidNamespaceWithAlias => "InvalidNamespaceWithAlias",
Code::InvalidServiceAliasOwners => "InvalidServiceAliasOwners",
Code::InvalidInstanceProtocol => "InvalidInstanceProtocol",
Code::InvalidInstanceVersion => "InvalidInstanceVersion",
Code::InvalidInstanceLogicSet => "InvalidInstanceLogicSet",
Code::InvalidInstanceIsolate => "InvalidInstanceIsolate",
Code::HealthCheckNotOpen => "HealthCheckNotOpen",
Code::HeartbeatOnDisabledIns => "HeartbeatOnDisabledIns",
Code::HeartbeatExceedLimit => "HeartbeatExceedLimit",
Code::HeartbeatTypeNotFound => "HeartbeatTypeNotFound",
Code::InvalidMetadata => "InvalidMetadata",
Code::InvalidRateLimitId => "InvalidRateLimitID",
Code::InvalidRateLimitLabels => "InvalidRateLimitLabels",
Code::InvalidRateLimitAmounts => "InvalidRateLimitAmounts",
Code::InvalidRateLimitName => "InvalidRateLimitName",
Code::InvalidCircuitBreakerId => "InvalidCircuitBreakerID",
Code::InvalidCircuitBreakerVersion => "InvalidCircuitBreakerVersion",
Code::InvalidCircuitBreakerName => "InvalidCircuitBreakerName",
Code::InvalidCircuitBreakerNamespace => "InvalidCircuitBreakerNamespace",
Code::InvalidCircuitBreakerOwners => "InvalidCircuitBreakerOwners",
Code::InvalidCircuitBreakerToken => "InvalidCircuitBreakerToken",
Code::InvalidCircuitBreakerBusiness => "InvalidCircuitBreakerBusiness",
Code::InvalidCircuitBreakerDepartment => "InvalidCircuitBreakerDepartment",
Code::InvalidCircuitBreakerComment => "InvalidCircuitBreakerComment",
Code::CircuitBreakerRuleExisted => "CircuitBreakerRuleExisted",
Code::InvalidRoutingId => "InvalidRoutingID",
Code::InvalidRoutingPolicy => "InvalidRoutingPolicy",
Code::InvalidRoutingName => "InvalidRoutingName",
Code::InvalidRoutingPriority => "InvalidRoutingPriority",
Code::InvalidFaultDetectId => "InvalidFaultDetectID",
Code::InvalidFaultDetectName => "InvalidFaultDetectName",
Code::InvalidFaultDetectNamespace => "InvalidFaultDetectNamespace",
Code::FaultDetectRuleExisted => "FaultDetectRuleExisted",
Code::InvalidMatchRule => "InvalidMatchRule",
Code::ServicesExistedMesh => "ServicesExistedMesh",
Code::ResourcesExistedMesh => "ResourcesExistedMesh",
Code::InvalidMeshParameter => "InvalidMeshParameter",
Code::InvalidPlatformId => "InvalidPlatformID",
Code::InvalidPlatformName => "InvalidPlatformName",
Code::InvalidPlatformDomain => "InvalidPlatformDomain",
Code::InvalidPlatformQps => "InvalidPlatformQPS",
Code::InvalidPlatformToken => "InvalidPlatformToken",
Code::InvalidPlatformOwner => "InvalidPlatformOwner",
Code::InvalidPlatformDepartment => "InvalidPlatformDepartment",
Code::InvalidPlatformComment => "InvalidPlatformComment",
Code::NotFoundPlatform => "NotFoundPlatform",
Code::InvalidFluxRateLimitId => "InvalidFluxRateLimitId",
Code::InvalidFluxRateLimitQps => "InvalidFluxRateLimitQps",
Code::InvalidFluxRateLimitSetKey => "InvalidFluxRateLimitSetKey",
Code::ExistedResource => "ExistedResource",
Code::NotFoundResource => "NotFoundResource",
Code::NamespaceExistedServices => "NamespaceExistedServices",
Code::ServiceExistedInstances => "ServiceExistedInstances",
Code::ServiceExistedRoutings => "ServiceExistedRoutings",
Code::ServiceExistedRateLimits => "ServiceExistedRateLimits",
Code::ExistReleasedConfig => "ExistReleasedConfig",
Code::SameInstanceRequest => "SameInstanceRequest",
Code::ServiceExistedCircuitBreakers => "ServiceExistedCircuitBreakers",
Code::ServiceExistedAlias => "ServiceExistedAlias",
Code::NamespaceExistedMeshResources => "NamespaceExistedMeshResources",
Code::NamespaceExistedCircuitBreakers => "NamespaceExistedCircuitBreakers",
Code::ServiceSubscribedByMeshes => "ServiceSubscribedByMeshes",
Code::ServiceExistedFluxRateLimits => "ServiceExistedFluxRateLimits",
Code::NamespaceExistedConfigGroups => "NamespaceExistedConfigGroups",
Code::NotFoundService => "NotFoundService",
Code::NotFoundRouting => "NotFoundRouting",
Code::NotFoundInstance => "NotFoundInstance",
Code::NotFoundServiceAlias => "NotFoundServiceAlias",
Code::NotFoundNamespace => "NotFoundNamespace",
Code::NotFoundSourceService => "NotFoundSourceService",
Code::NotFoundRateLimit => "NotFoundRateLimit",
Code::NotFoundCircuitBreaker => "NotFoundCircuitBreaker",
Code::NotFoundMasterConfig => "NotFoundMasterConfig",
Code::NotFoundTagConfig => "NotFoundTagConfig",
Code::NotFoundTagConfigOrService => "NotFoundTagConfigOrService",
Code::ClientApiNotOpen => "ClientAPINotOpen",
Code::NotAllowBusinessService => "NotAllowBusinessService",
Code::NotAllowAliasUpdate => "NotAllowAliasUpdate",
Code::NotAllowAliasCreateInstance => "NotAllowAliasCreateInstance",
Code::NotAllowAliasCreateRouting => "NotAllowAliasCreateRouting",
Code::NotAllowCreateAliasForAlias => "NotAllowCreateAliasForAlias",
Code::NotAllowAliasCreateRateLimit => "NotAllowAliasCreateRateLimit",
Code::NotAllowAliasBindRule => "NotAllowAliasBindRule",
Code::NotAllowDifferentNamespaceBindRule => {
"NotAllowDifferentNamespaceBindRule"
}
Code::Unauthorized => "Unauthorized",
Code::NotAllowedAccess => "NotAllowedAccess",
Code::CmdbNotFindHost => "CMDBNotFindHost",
Code::DataConflict => "DataConflict",
Code::InstanceTooManyRequests => "InstanceTooManyRequests",
Code::IpRateLimit => "IPRateLimit",
Code::ApiRateLimit => "APIRateLimit",
Code::ExecuteException => "ExecuteException",
Code::StoreLayerException => "StoreLayerException",
Code::CmdbPluginException => "CMDBPluginException",
Code::ParseRoutingException => "ParseRoutingException",
Code::ParseRateLimitException => "ParseRateLimitException",
Code::ParseCircuitBreakerException => "ParseCircuitBreakerException",
Code::HeartbeatException => "HeartbeatException",
Code::InstanceRegisTimeout => "InstanceRegisTimeout",
Code::InvalidConfigFileGroupName => "InvalidConfigFileGroupName",
Code::InvalidConfigFileName => "InvalidConfigFileName",
Code::InvalidConfigFileContentLength => "InvalidConfigFileContentLength",
Code::InvalidConfigFileFormat => "InvalidConfigFileFormat",
Code::InvalidConfigFileTags => "InvalidConfigFileTags",
Code::InvalidWatchConfigFileFormat => "InvalidWatchConfigFileFormat",
Code::NotFoundResourceConfigFile => "NotFoundResourceConfigFile",
Code::InvalidConfigFileTemplateName => "InvalidConfigFileTemplateName",
Code::EncryptConfigFileException => "EncryptConfigFileException",
Code::GroupExistActiveRelease => "GroupExistActiveRelease",
Code::DecryptConfigFileException => "DecryptConfigFileException",
Code::InvalidUserOwners => "InvalidUserOwners",
Code::InvalidUserId => "InvalidUserID",
Code::InvalidUserPassword => "InvalidUserPassword",
Code::InvalidUserMobile => "InvalidUserMobile",
Code::InvalidUserEmail => "InvalidUserEmail",
Code::InvalidUserGroupOwners => "InvalidUserGroupOwners",
Code::InvalidUserGroupId => "InvalidUserGroupID",
Code::InvalidAuthStrategyOwners => "InvalidAuthStrategyOwners",
Code::InvalidAuthStrategyName => "InvalidAuthStrategyName",
Code::InvalidAuthStrategyId => "InvalidAuthStrategyID",
Code::InvalidPrincipalType => "InvalidPrincipalType",
Code::UserExisted => "UserExisted",
Code::UserGroupExisted => "UserGroupExisted",
Code::AuthStrategyRuleExisted => "AuthStrategyRuleExisted",
Code::SubAccountExisted => "SubAccountExisted",
Code::NotFoundUser => "NotFoundUser",
Code::NotFoundOwnerUser => "NotFoundOwnerUser",
Code::NotFoundUserGroup => "NotFoundUserGroup",
Code::NotFoundAuthStrategyRule => "NotFoundAuthStrategyRule",
Code::NotAllowModifyDefaultStrategyPrincipal => {
"NotAllowModifyDefaultStrategyPrincipal"
}
Code::NotAllowModifyOwnerDefaultStrategy => {
"NotAllowModifyOwnerDefaultStrategy"
}
Code::EmptyAutToken => "EmptyAutToken",
Code::TokenDisabled => "TokenDisabled",
Code::TokenNotExisted => "TokenNotExisted",
Code::AuthTokenForbidden => "AuthTokenForbidden",
Code::OperationRoleForbidden => "OperationRoleForbidden",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unknown" => Some(Self::Unknown),
"ExecuteSuccess" => Some(Self::ExecuteSuccess),
"DataNoChange" => Some(Self::DataNoChange),
"NoNeedUpdate" => Some(Self::NoNeedUpdate),
"BadRequest" => Some(Self::BadRequest),
"ParseException" => Some(Self::ParseException),
"EmptyRequest" => Some(Self::EmptyRequest),
"BatchSizeOverLimit" => Some(Self::BatchSizeOverLimit),
"InvalidDiscoverResource" => Some(Self::InvalidDiscoverResource),
"InvalidRequestID" => Some(Self::InvalidRequestId),
"InvalidUserName" => Some(Self::InvalidUserName),
"InvalidUserToken" => Some(Self::InvalidUserToken),
"InvalidParameter" => Some(Self::InvalidParameter),
"EmptyQueryParameter" => Some(Self::EmptyQueryParameter),
"InvalidQueryInsParameter" => Some(Self::InvalidQueryInsParameter),
"InvalidNamespaceName" => Some(Self::InvalidNamespaceName),
"InvalidNamespaceOwners" => Some(Self::InvalidNamespaceOwners),
"InvalidNamespaceToken" => Some(Self::InvalidNamespaceToken),
"InvalidServiceName" => Some(Self::InvalidServiceName),
"InvalidServiceOwners" => Some(Self::InvalidServiceOwners),
"InvalidServiceToken" => Some(Self::InvalidServiceToken),
"InvalidServiceMetadata" => Some(Self::InvalidServiceMetadata),
"InvalidServicePorts" => Some(Self::InvalidServicePorts),
"InvalidServiceBusiness" => Some(Self::InvalidServiceBusiness),
"InvalidServiceDepartment" => Some(Self::InvalidServiceDepartment),
"InvalidServiceCMDB" => Some(Self::InvalidServiceCmdb),
"InvalidServiceComment" => Some(Self::InvalidServiceComment),
"InvalidServiceAliasComment" => Some(Self::InvalidServiceAliasComment),
"InvalidInstanceID" => Some(Self::InvalidInstanceId),
"InvalidInstanceHost" => Some(Self::InvalidInstanceHost),
"InvalidInstancePort" => Some(Self::InvalidInstancePort),
"InvalidServiceAlias" => Some(Self::InvalidServiceAlias),
"InvalidNamespaceWithAlias" => Some(Self::InvalidNamespaceWithAlias),
"InvalidServiceAliasOwners" => Some(Self::InvalidServiceAliasOwners),
"InvalidInstanceProtocol" => Some(Self::InvalidInstanceProtocol),
"InvalidInstanceVersion" => Some(Self::InvalidInstanceVersion),
"InvalidInstanceLogicSet" => Some(Self::InvalidInstanceLogicSet),
"InvalidInstanceIsolate" => Some(Self::InvalidInstanceIsolate),
"HealthCheckNotOpen" => Some(Self::HealthCheckNotOpen),
"HeartbeatOnDisabledIns" => Some(Self::HeartbeatOnDisabledIns),
"HeartbeatExceedLimit" => Some(Self::HeartbeatExceedLimit),
"HeartbeatTypeNotFound" => Some(Self::HeartbeatTypeNotFound),
"InvalidMetadata" => Some(Self::InvalidMetadata),
"InvalidRateLimitID" => Some(Self::InvalidRateLimitId),
"InvalidRateLimitLabels" => Some(Self::InvalidRateLimitLabels),
"InvalidRateLimitAmounts" => Some(Self::InvalidRateLimitAmounts),
"InvalidRateLimitName" => Some(Self::InvalidRateLimitName),
"InvalidCircuitBreakerID" => Some(Self::InvalidCircuitBreakerId),
"InvalidCircuitBreakerVersion" => Some(Self::InvalidCircuitBreakerVersion),
"InvalidCircuitBreakerName" => Some(Self::InvalidCircuitBreakerName),
"InvalidCircuitBreakerNamespace" => {
Some(Self::InvalidCircuitBreakerNamespace)
}
"InvalidCircuitBreakerOwners" => Some(Self::InvalidCircuitBreakerOwners),
"InvalidCircuitBreakerToken" => Some(Self::InvalidCircuitBreakerToken),
"InvalidCircuitBreakerBusiness" => Some(Self::InvalidCircuitBreakerBusiness),
"InvalidCircuitBreakerDepartment" => {
Some(Self::InvalidCircuitBreakerDepartment)
}
"InvalidCircuitBreakerComment" => Some(Self::InvalidCircuitBreakerComment),
"CircuitBreakerRuleExisted" => Some(Self::CircuitBreakerRuleExisted),
"InvalidRoutingID" => Some(Self::InvalidRoutingId),
"InvalidRoutingPolicy" => Some(Self::InvalidRoutingPolicy),
"InvalidRoutingName" => Some(Self::InvalidRoutingName),
"InvalidRoutingPriority" => Some(Self::InvalidRoutingPriority),
"InvalidFaultDetectID" => Some(Self::InvalidFaultDetectId),
"InvalidFaultDetectName" => Some(Self::InvalidFaultDetectName),
"InvalidFaultDetectNamespace" => Some(Self::InvalidFaultDetectNamespace),
"FaultDetectRuleExisted" => Some(Self::FaultDetectRuleExisted),
"InvalidMatchRule" => Some(Self::InvalidMatchRule),
"ServicesExistedMesh" => Some(Self::ServicesExistedMesh),
"ResourcesExistedMesh" => Some(Self::ResourcesExistedMesh),
"InvalidMeshParameter" => Some(Self::InvalidMeshParameter),
"InvalidPlatformID" => Some(Self::InvalidPlatformId),
"InvalidPlatformName" => Some(Self::InvalidPlatformName),
"InvalidPlatformDomain" => Some(Self::InvalidPlatformDomain),
"InvalidPlatformQPS" => Some(Self::InvalidPlatformQps),
"InvalidPlatformToken" => Some(Self::InvalidPlatformToken),
"InvalidPlatformOwner" => Some(Self::InvalidPlatformOwner),
"InvalidPlatformDepartment" => Some(Self::InvalidPlatformDepartment),
"InvalidPlatformComment" => Some(Self::InvalidPlatformComment),
"NotFoundPlatform" => Some(Self::NotFoundPlatform),
"InvalidFluxRateLimitId" => Some(Self::InvalidFluxRateLimitId),
"InvalidFluxRateLimitQps" => Some(Self::InvalidFluxRateLimitQps),
"InvalidFluxRateLimitSetKey" => Some(Self::InvalidFluxRateLimitSetKey),
"ExistedResource" => Some(Self::ExistedResource),
"NotFoundResource" => Some(Self::NotFoundResource),
"NamespaceExistedServices" => Some(Self::NamespaceExistedServices),
"ServiceExistedInstances" => Some(Self::ServiceExistedInstances),
"ServiceExistedRoutings" => Some(Self::ServiceExistedRoutings),
"ServiceExistedRateLimits" => Some(Self::ServiceExistedRateLimits),
"ExistReleasedConfig" => Some(Self::ExistReleasedConfig),
"SameInstanceRequest" => Some(Self::SameInstanceRequest),
"ServiceExistedCircuitBreakers" => Some(Self::ServiceExistedCircuitBreakers),
"ServiceExistedAlias" => Some(Self::ServiceExistedAlias),
"NamespaceExistedMeshResources" => Some(Self::NamespaceExistedMeshResources),
"NamespaceExistedCircuitBreakers" => {
Some(Self::NamespaceExistedCircuitBreakers)
}
"ServiceSubscribedByMeshes" => Some(Self::ServiceSubscribedByMeshes),
"ServiceExistedFluxRateLimits" => Some(Self::ServiceExistedFluxRateLimits),
"NamespaceExistedConfigGroups" => Some(Self::NamespaceExistedConfigGroups),
"NotFoundService" => Some(Self::NotFoundService),
"NotFoundRouting" => Some(Self::NotFoundRouting),
"NotFoundInstance" => Some(Self::NotFoundInstance),
"NotFoundServiceAlias" => Some(Self::NotFoundServiceAlias),
"NotFoundNamespace" => Some(Self::NotFoundNamespace),
"NotFoundSourceService" => Some(Self::NotFoundSourceService),
"NotFoundRateLimit" => Some(Self::NotFoundRateLimit),
"NotFoundCircuitBreaker" => Some(Self::NotFoundCircuitBreaker),
"NotFoundMasterConfig" => Some(Self::NotFoundMasterConfig),
"NotFoundTagConfig" => Some(Self::NotFoundTagConfig),
"NotFoundTagConfigOrService" => Some(Self::NotFoundTagConfigOrService),
"ClientAPINotOpen" => Some(Self::ClientApiNotOpen),
"NotAllowBusinessService" => Some(Self::NotAllowBusinessService),
"NotAllowAliasUpdate" => Some(Self::NotAllowAliasUpdate),
"NotAllowAliasCreateInstance" => Some(Self::NotAllowAliasCreateInstance),
"NotAllowAliasCreateRouting" => Some(Self::NotAllowAliasCreateRouting),
"NotAllowCreateAliasForAlias" => Some(Self::NotAllowCreateAliasForAlias),
"NotAllowAliasCreateRateLimit" => Some(Self::NotAllowAliasCreateRateLimit),
"NotAllowAliasBindRule" => Some(Self::NotAllowAliasBindRule),
"NotAllowDifferentNamespaceBindRule" => {
Some(Self::NotAllowDifferentNamespaceBindRule)
}
"Unauthorized" => Some(Self::Unauthorized),
"NotAllowedAccess" => Some(Self::NotAllowedAccess),
"CMDBNotFindHost" => Some(Self::CmdbNotFindHost),
"DataConflict" => Some(Self::DataConflict),
"InstanceTooManyRequests" => Some(Self::InstanceTooManyRequests),
"IPRateLimit" => Some(Self::IpRateLimit),
"APIRateLimit" => Some(Self::ApiRateLimit),
"ExecuteException" => Some(Self::ExecuteException),
"StoreLayerException" => Some(Self::StoreLayerException),
"CMDBPluginException" => Some(Self::CmdbPluginException),
"ParseRoutingException" => Some(Self::ParseRoutingException),
"ParseRateLimitException" => Some(Self::ParseRateLimitException),
"ParseCircuitBreakerException" => Some(Self::ParseCircuitBreakerException),
"HeartbeatException" => Some(Self::HeartbeatException),
"InstanceRegisTimeout" => Some(Self::InstanceRegisTimeout),
"InvalidConfigFileGroupName" => Some(Self::InvalidConfigFileGroupName),
"InvalidConfigFileName" => Some(Self::InvalidConfigFileName),
"InvalidConfigFileContentLength" => {
Some(Self::InvalidConfigFileContentLength)
}
"InvalidConfigFileFormat" => Some(Self::InvalidConfigFileFormat),
"InvalidConfigFileTags" => Some(Self::InvalidConfigFileTags),
"InvalidWatchConfigFileFormat" => Some(Self::InvalidWatchConfigFileFormat),
"NotFoundResourceConfigFile" => Some(Self::NotFoundResourceConfigFile),
"InvalidConfigFileTemplateName" => Some(Self::InvalidConfigFileTemplateName),
"EncryptConfigFileException" => Some(Self::EncryptConfigFileException),
"GroupExistActiveRelease" => Some(Self::GroupExistActiveRelease),
"DecryptConfigFileException" => Some(Self::DecryptConfigFileException),
"InvalidUserOwners" => Some(Self::InvalidUserOwners),
"InvalidUserID" => Some(Self::InvalidUserId),
"InvalidUserPassword" => Some(Self::InvalidUserPassword),
"InvalidUserMobile" => Some(Self::InvalidUserMobile),
"InvalidUserEmail" => Some(Self::InvalidUserEmail),
"InvalidUserGroupOwners" => Some(Self::InvalidUserGroupOwners),
"InvalidUserGroupID" => Some(Self::InvalidUserGroupId),
"InvalidAuthStrategyOwners" => Some(Self::InvalidAuthStrategyOwners),
"InvalidAuthStrategyName" => Some(Self::InvalidAuthStrategyName),
"InvalidAuthStrategyID" => Some(Self::InvalidAuthStrategyId),
"InvalidPrincipalType" => Some(Self::InvalidPrincipalType),
"UserExisted" => Some(Self::UserExisted),
"UserGroupExisted" => Some(Self::UserGroupExisted),
"AuthStrategyRuleExisted" => Some(Self::AuthStrategyRuleExisted),
"SubAccountExisted" => Some(Self::SubAccountExisted),
"NotFoundUser" => Some(Self::NotFoundUser),
"NotFoundOwnerUser" => Some(Self::NotFoundOwnerUser),
"NotFoundUserGroup" => Some(Self::NotFoundUserGroup),
"NotFoundAuthStrategyRule" => Some(Self::NotFoundAuthStrategyRule),
"NotAllowModifyDefaultStrategyPrincipal" => {
Some(Self::NotAllowModifyDefaultStrategyPrincipal)
}
"NotAllowModifyOwnerDefaultStrategy" => {
Some(Self::NotAllowModifyOwnerDefaultStrategy)
}
"EmptyAutToken" => Some(Self::EmptyAutToken),
"TokenDisabled" => Some(Self::TokenDisabled),
"TokenNotExisted" => Some(Self::TokenNotExisted),
"AuthTokenForbidden" => Some(Self::AuthTokenForbidden),
"OperationRoleForbidden" => Some(Self::OperationRoleForbidden),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FaultDetector {
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<FaultDetectRule>,
#[prost(string, tag = "2")]
pub revision: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FaultDetectRule {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "21")]
pub target_service: ::core::option::Option<fault_detect_rule::DestinationService>,
#[prost(uint32, tag = "22")]
pub interval: u32,
#[prost(uint32, tag = "23")]
pub timeout: u32,
#[prost(uint32, tag = "24")]
pub port: u32,
#[prost(enumeration = "fault_detect_rule::Protocol", tag = "25")]
pub protocol: i32,
#[prost(message, optional, tag = "26")]
pub http_config: ::core::option::Option<HttpProtocolConfig>,
#[prost(message, optional, tag = "27")]
pub tcp_config: ::core::option::Option<TcpProtocolConfig>,
#[prost(message, optional, tag = "28")]
pub udp_config: ::core::option::Option<UdpProtocolConfig>,
#[prost(uint32, tag = "29")]
pub priority: u32,
#[prost(map = "string, string", tag = "30")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "31")]
pub extend_info: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "40")]
pub editable: bool,
#[prost(bool, tag = "41")]
pub deleteable: bool,
}
pub mod fault_detect_rule {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DestinationService {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[deprecated]
#[prost(message, optional, tag = "3")]
pub method: ::core::option::Option<super::MatchString>,
#[prost(message, optional, tag = "4")]
pub api: ::core::option::Option<super::Api>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Protocol {
Unknown = 0,
Http = 1,
Tcp = 2,
Udp = 3,
}
impl Protocol {
pub fn as_str_name(&self) -> &'static str {
match self {
Protocol::Unknown => "UNKNOWN",
Protocol::Http => "HTTP",
Protocol::Tcp => "TCP",
Protocol::Udp => "UDP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"HTTP" => Some(Self::Http),
"TCP" => Some(Self::Tcp),
"UDP" => Some(Self::Udp),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpProtocolConfig {
#[prost(string, tag = "1")]
pub method: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub headers: ::prost::alloc::vec::Vec<http_protocol_config::MessageHeader>,
#[prost(string, tag = "4")]
pub body: ::prost::alloc::string::String,
}
pub mod http_protocol_config {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageHeader {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TcpProtocolConfig {
#[prost(string, tag = "1")]
pub send: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UdpProtocolConfig {
#[prost(string, tag = "1")]
pub send: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Namespace {
#[prost(message, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub owners: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub total_service_count: ::core::option::Option<u32>,
#[prost(message, optional, tag = "8")]
pub total_health_instance_count: ::core::option::Option<u32>,
#[prost(message, optional, tag = "9")]
pub total_instance_count: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "10")]
pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "11")]
pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "13")]
pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "14")]
pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub editable: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "16")]
pub service_export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "17")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "18")]
pub deleteable: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Service {
#[prost(message, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "4")]
pub ports: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub business: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub department: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub cmdb_mod1: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub cmdb_mod2: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub cmdb_mod3: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub owners: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "13")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "14")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub platform_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "17")]
pub total_instance_count: ::core::option::Option<u32>,
#[prost(message, optional, tag = "18")]
pub healthy_instance_count: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "19")]
pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "20")]
pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "22")]
pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "23")]
pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "21")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "24")]
pub editable: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "25")]
pub export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "26")]
pub deleteable: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceAlias {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub alias: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub alias_namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "AliasType", tag = "5")]
pub r#type: i32,
#[prost(message, optional, tag = "6")]
pub owners: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub service_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub editable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "13")]
pub deleteable: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instance {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "21")]
pub vpc_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub host: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub port: ::core::option::Option<u32>,
#[prost(message, optional, tag = "6")]
pub protocol: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub version: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub priority: ::core::option::Option<u32>,
#[prost(message, optional, tag = "9")]
pub weight: ::core::option::Option<u32>,
#[prost(message, optional, tag = "20")]
pub enable_health_check: ::core::option::Option<bool>,
#[prost(message, optional, tag = "10")]
pub health_check: ::core::option::Option<HealthCheck>,
#[prost(message, optional, tag = "11")]
pub healthy: ::core::option::Option<bool>,
#[prost(message, optional, tag = "12")]
pub isolate: ::core::option::Option<bool>,
#[prost(message, optional, tag = "13")]
pub location: ::core::option::Option<Location>,
#[prost(map = "string, string", tag = "14")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "15")]
pub logic_set: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "17")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "18")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "19")]
pub service_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheck {
#[prost(enumeration = "health_check::HealthCheckType", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub heartbeat: ::core::option::Option<HeartbeatHealthCheck>,
}
pub mod health_check {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum HealthCheckType {
Unknown = 0,
Heartbeat = 1,
}
impl HealthCheckType {
pub fn as_str_name(&self) -> &'static str {
match self {
HealthCheckType::Unknown => "UNKNOWN",
HealthCheckType::Heartbeat => "HEARTBEAT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"HEARTBEAT" => Some(Self::Heartbeat),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatHealthCheck {
#[prost(message, optional, tag = "1")]
pub ttl: ::core::option::Option<u32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AliasType {
Default = 0,
Cl5sid = 1,
}
impl AliasType {
pub fn as_str_name(&self) -> &'static str {
match self {
AliasType::Default => "DEFAULT",
AliasType::Cl5sid => "CL5SID",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT" => Some(Self::Default),
"CL5SID" => Some(Self::Cl5sid),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RateLimit {
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<Rule>,
#[prost(message, optional, tag = "2")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rule {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "4")]
pub subset: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
#[prost(message, optional, tag = "5")]
pub priority: ::core::option::Option<u32>,
#[prost(enumeration = "rule::Resource", tag = "6")]
pub resource: i32,
#[prost(enumeration = "rule::Type", tag = "7")]
pub r#type: i32,
#[prost(map = "string, message", tag = "8")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
#[prost(message, repeated, tag = "9")]
pub amounts: ::prost::alloc::vec::Vec<Amount>,
#[prost(message, optional, tag = "10")]
pub action: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub disable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "12")]
pub report: ::core::option::Option<Report>,
#[prost(message, optional, tag = "13")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "14")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "15")]
pub revision: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "16")]
pub service_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "17")]
pub adjuster: ::core::option::Option<AmountAdjuster>,
#[prost(message, optional, tag = "18")]
pub regex_combine: ::core::option::Option<bool>,
#[prost(enumeration = "rule::AmountMode", tag = "19")]
pub amount_mode: i32,
#[prost(enumeration = "rule::FailoverType", tag = "20")]
pub failover: i32,
#[prost(message, optional, tag = "21")]
pub cluster: ::core::option::Option<RateLimitCluster>,
#[prost(message, optional, tag = "22")]
pub method: ::core::option::Option<MatchString>,
#[prost(message, repeated, tag = "23")]
pub arguments: ::prost::alloc::vec::Vec<MatchArgument>,
#[prost(message, optional, tag = "24")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "25")]
pub etime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "26")]
pub max_queue_delay: ::core::option::Option<u32>,
#[prost(message, optional, tag = "27")]
pub concurrency_amount: ::core::option::Option<ConcurrencyAmount>,
#[prost(message, optional, tag = "28")]
pub custom_response: ::core::option::Option<CustomResponse>,
#[prost(map = "string, string", tag = "29")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "30")]
pub editable: bool,
#[prost(bool, tag = "31")]
pub deleteable: bool,
}
pub mod rule {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Resource {
Qps = 0,
Concurrency = 1,
}
impl Resource {
pub fn as_str_name(&self) -> &'static str {
match self {
Resource::Qps => "QPS",
Resource::Concurrency => "CONCURRENCY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"QPS" => Some(Self::Qps),
"CONCURRENCY" => Some(Self::Concurrency),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Global = 0,
Local = 1,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Global => "GLOBAL",
Type::Local => "LOCAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"GLOBAL" => Some(Self::Global),
"LOCAL" => Some(Self::Local),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AmountMode {
GlobalTotal = 0,
ShareEqually = 1,
}
impl AmountMode {
pub fn as_str_name(&self) -> &'static str {
match self {
AmountMode::GlobalTotal => "GLOBAL_TOTAL",
AmountMode::ShareEqually => "SHARE_EQUALLY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"GLOBAL_TOTAL" => Some(Self::GlobalTotal),
"SHARE_EQUALLY" => Some(Self::ShareEqually),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum FailoverType {
FailoverLocal = 0,
FailoverPass = 1,
}
impl FailoverType {
pub fn as_str_name(&self) -> &'static str {
match self {
FailoverType::FailoverLocal => "FAILOVER_LOCAL",
FailoverType::FailoverPass => "FAILOVER_PASS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FAILOVER_LOCAL" => Some(Self::FailoverLocal),
"FAILOVER_PASS" => Some(Self::FailoverPass),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchArgument {
#[prost(enumeration = "match_argument::Type", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub value: ::core::option::Option<MatchString>,
}
pub mod match_argument {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Custom = 0,
Method = 1,
Header = 2,
Query = 3,
CallerService = 4,
CallerIp = 5,
CallerMetadata = 6,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Custom => "CUSTOM",
Type::Method => "METHOD",
Type::Header => "HEADER",
Type::Query => "QUERY",
Type::CallerService => "CALLER_SERVICE",
Type::CallerIp => "CALLER_IP",
Type::CallerMetadata => "CALLER_METADATA",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CUSTOM" => Some(Self::Custom),
"METHOD" => Some(Self::Method),
"HEADER" => Some(Self::Header),
"QUERY" => Some(Self::Query),
"CALLER_SERVICE" => Some(Self::CallerService),
"CALLER_IP" => Some(Self::CallerIp),
"CALLER_METADATA" => Some(Self::CallerMetadata),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConcurrencyAmount {
#[prost(uint32, tag = "1")]
pub max_amount: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomResponse {
#[prost(string, tag = "3")]
pub body: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RateLimitCluster {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Amount {
#[prost(message, optional, tag = "1")]
pub max_amount: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub valid_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "3")]
pub precision: ::core::option::Option<u32>,
#[prost(message, optional, tag = "4")]
pub start_amount: ::core::option::Option<u32>,
#[prost(message, optional, tag = "5")]
pub min_amount: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Report {
#[prost(message, optional, tag = "1")]
pub interval: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "2")]
pub amount_percent: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmountAdjuster {
#[prost(message, optional, tag = "1")]
pub climb: ::core::option::Option<ClimbConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClimbConfig {
#[prost(message, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub metric: ::core::option::Option<climb_config::MetricConfig>,
#[prost(message, optional, tag = "3")]
pub policy: ::core::option::Option<climb_config::TriggerPolicy>,
#[prost(message, optional, tag = "4")]
pub throttling: ::core::option::Option<climb_config::ClimbThrottling>,
}
pub mod climb_config {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetricConfig {
#[prost(message, optional, tag = "1")]
pub window: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "2")]
pub precision: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub report_interval: ::core::option::Option<::prost_types::Duration>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TriggerPolicy {
#[prost(message, optional, tag = "1")]
pub error_rate: ::core::option::Option<trigger_policy::ErrorRate>,
#[prost(message, optional, tag = "2")]
pub slow_rate: ::core::option::Option<trigger_policy::SlowRate>,
}
pub mod trigger_policy {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorRate {
#[prost(message, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub request_volume_threshold: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub error_rate: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "4")]
pub specials: ::prost::alloc::vec::Vec<error_rate::SpecialConfig>,
}
pub mod error_rate {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpecialConfig {
#[prost(message, optional, tag = "1")]
pub r#type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub error_codes: ::prost::alloc::vec::Vec<i64>,
#[prost(message, optional, tag = "3")]
pub error_rate: ::core::option::Option<i32>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SlowRate {
#[prost(message, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub max_rt: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "3")]
pub slow_rate: ::core::option::Option<i32>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClimbThrottling {
#[prost(message, optional, tag = "1")]
pub cold_below_tune_down_rate: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub cold_below_tune_up_rate: ::core::option::Option<i32>,
#[prost(message, optional, tag = "3")]
pub cold_above_tune_down_rate: ::core::option::Option<i32>,
#[prost(message, optional, tag = "4")]
pub cold_above_tune_up_rate: ::core::option::Option<i32>,
#[prost(message, optional, tag = "5")]
pub limit_threshold_to_tune_up: ::core::option::Option<i32>,
#[prost(message, optional, tag = "6")]
pub judge_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "7")]
pub tune_up_period: ::core::option::Option<i32>,
#[prost(message, optional, tag = "8")]
pub tune_down_period: ::core::option::Option<i32>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Client {
#[prost(message, optional, tag = "1")]
pub host: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "client::ClientType", tag = "2")]
pub r#type: i32,
#[prost(message, optional, tag = "3")]
pub version: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub location: ::core::option::Option<Location>,
#[prost(message, optional, tag = "5")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "6")]
pub stat: ::prost::alloc::vec::Vec<StatInfo>,
#[prost(message, optional, tag = "7")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod client {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ClientType {
Unknown = 0,
Sdk = 1,
Agent = 2,
}
impl ClientType {
pub fn as_str_name(&self) -> &'static str {
match self {
ClientType::Unknown => "UNKNOWN",
ClientType::Sdk => "SDK",
ClientType::Agent => "AGENT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SDK" => Some(Self::Sdk),
"AGENT" => Some(Self::Agent),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatInfo {
#[prost(message, optional, tag = "1")]
pub target: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub port: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub protocol: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigRelease {
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<Service>,
#[prost(message, optional, tag = "2")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigWithService {
#[prost(message, repeated, tag = "1")]
pub services: ::prost::alloc::vec::Vec<Service>,
#[prost(message, optional, tag = "2")]
pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoginRequest {
#[prost(message, optional, tag = "1")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "4")]
pub options: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoginResponse {
#[prost(message, optional, tag = "1")]
pub user_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub role: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub owner_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "6")]
pub options: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct User {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub source: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub token_enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "8")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub user_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub mobile: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "13")]
pub email: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "14")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModifyUserPassword {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub old_password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub new_password: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserGroupRelation {
#[prost(message, optional, tag = "1")]
pub group_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub users: ::prost::alloc::vec::Vec<User>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserGroup {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub token_enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "6")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub relation: ::core::option::Option<UserGroupRelation>,
#[prost(message, optional, tag = "10")]
pub user_count: ::core::option::Option<u32>,
#[prost(message, optional, tag = "11")]
pub source: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "12")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModifyUserGroup {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub token_enable: ::core::option::Option<bool>,
#[prost(message, optional, tag = "6")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub add_relations: ::core::option::Option<UserGroupRelation>,
#[prost(message, optional, tag = "8")]
pub remove_relations: ::core::option::Option<UserGroupRelation>,
#[prost(map = "string, string", tag = "9")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "10")]
pub source: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Role {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub owner: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub source: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub default_role: bool,
#[prost(map = "string, string", tag = "7")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "8")]
pub comment: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub mtime: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "20")]
pub users: ::prost::alloc::vec::Vec<User>,
#[prost(message, repeated, tag = "21")]
pub user_groups: ::prost::alloc::vec::Vec<UserGroup>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Principal {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Principals {
#[prost(message, repeated, tag = "1")]
pub users: ::prost::alloc::vec::Vec<Principal>,
#[prost(message, repeated, tag = "2")]
pub groups: ::prost::alloc::vec::Vec<Principal>,
#[prost(message, repeated, tag = "3")]
pub roles: ::prost::alloc::vec::Vec<Principal>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StrategyResourceEntry {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StrategyResources {
#[prost(message, optional, tag = "1")]
pub strategy_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub namespaces: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "3")]
pub services: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "4")]
pub config_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "5")]
pub route_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "6")]
pub ratelimit_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "7")]
pub circuitbreaker_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "8")]
pub faultdetect_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "9")]
pub lane_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "21")]
pub users: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "22")]
pub user_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "23")]
pub roles: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
#[prost(message, repeated, tag = "24")]
pub auth_policies: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StrategyResourceLabel {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub compare_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthStrategy {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub principals: ::core::option::Option<Principals>,
#[prost(message, optional, tag = "4")]
pub resources: ::core::option::Option<StrategyResources>,
#[prost(enumeration = "AuthAction", tag = "5")]
pub action: i32,
#[prost(message, optional, tag = "6")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub ctime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub mtime: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub auth_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub default_strategy: ::core::option::Option<bool>,
#[prost(map = "string, string", tag = "12")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "13")]
pub source: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "14")]
pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "15")]
pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModifyAuthStrategy {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub add_principals: ::core::option::Option<Principals>,
#[prost(message, optional, tag = "4")]
pub remove_principals: ::core::option::Option<Principals>,
#[prost(message, optional, tag = "5")]
pub add_resources: ::core::option::Option<StrategyResources>,
#[prost(message, optional, tag = "6")]
pub remove_resources: ::core::option::Option<StrategyResources>,
#[prost(enumeration = "AuthAction", tag = "7")]
pub action: i32,
#[prost(message, optional, tag = "8")]
pub comment: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "12")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "13")]
pub source: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "14")]
pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "15")]
pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AuthAction {
OnlyRead = 0,
ReadWrite = 1,
Allow = 10,
Deny = 11,
}
impl AuthAction {
pub fn as_str_name(&self) -> &'static str {
match self {
AuthAction::OnlyRead => "ONLY_READ",
AuthAction::ReadWrite => "READ_WRITE",
AuthAction::Allow => "ALLOW",
AuthAction::Deny => "DENY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ONLY_READ" => Some(Self::OnlyRead),
"READ_WRITE" => Some(Self::ReadWrite),
"ALLOW" => Some(Self::Allow),
"DENY" => Some(Self::Deny),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResourceType {
Namespaces = 0,
Services = 1,
ConfigGroups = 2,
RouteRules = 3,
RateLimitRules = 4,
CircuitBreakerRules = 5,
FaultDetectRules = 6,
LaneRules = 7,
Users = 20,
UserGroups = 21,
Roles = 22,
PolicyRules = 23,
}
impl ResourceType {
pub fn as_str_name(&self) -> &'static str {
match self {
ResourceType::Namespaces => "Namespaces",
ResourceType::Services => "Services",
ResourceType::ConfigGroups => "ConfigGroups",
ResourceType::RouteRules => "RouteRules",
ResourceType::RateLimitRules => "RateLimitRules",
ResourceType::CircuitBreakerRules => "CircuitBreakerRules",
ResourceType::FaultDetectRules => "FaultDetectRules",
ResourceType::LaneRules => "LaneRules",
ResourceType::Users => "Users",
ResourceType::UserGroups => "UserGroups",
ResourceType::Roles => "Roles",
ResourceType::PolicyRules => "PolicyRules",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Namespaces" => Some(Self::Namespaces),
"Services" => Some(Self::Services),
"ConfigGroups" => Some(Self::ConfigGroups),
"RouteRules" => Some(Self::RouteRules),
"RateLimitRules" => Some(Self::RateLimitRules),
"CircuitBreakerRules" => Some(Self::CircuitBreakerRules),
"FaultDetectRules" => Some(Self::FaultDetectRules),
"LaneRules" => Some(Self::LaneRules),
"Users" => Some(Self::Users),
"UserGroups" => Some(Self::UserGroups),
"Roles" => Some(Self::Roles),
"PolicyRules" => Some(Self::PolicyRules),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceContract {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub protocol: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub content: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "9")]
pub interfaces: ::prost::alloc::vec::Vec<InterfaceDescriptor>,
#[prost(string, tag = "10")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub r#type: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "15")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterfaceDescriptor {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub method: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub content: ::prost::alloc::string::String,
#[prost(enumeration = "interface_descriptor::Source", tag = "5")]
pub source: i32,
#[prost(string, tag = "6")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub protocol: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub r#type: ::prost::alloc::string::String,
}
pub mod interface_descriptor {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Source {
Unknown = 0,
Manual = 1,
Client = 2,
}
impl Source {
pub fn as_str_name(&self) -> &'static str {
match self {
Source::Unknown => "UNKNOWN",
Source::Manual => "Manual",
Source::Client => "Client",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"Manual" => Some(Self::Manual),
"Client" => Some(Self::Client),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrafficEntry {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub selector: ::core::option::Option<::prost_types::Any>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceGatewaySelector {
#[prost(string, tag = "1")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub service: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "3")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceSelector {
#[prost(string, tag = "1")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub service: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "3")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LaneGroup {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub entries: ::prost::alloc::vec::Vec<TrafficEntry>,
#[prost(message, repeated, tag = "4")]
pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
#[prost(string, tag = "7")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub mtime: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "11")]
pub rules: ::prost::alloc::vec::Vec<LaneRule>,
#[prost(map = "string, string", tag = "12")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "20")]
pub editable: bool,
#[prost(bool, tag = "21")]
pub deleteable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrafficMatchRule {
#[prost(message, repeated, tag = "4")]
pub arguments: ::prost::alloc::vec::Vec<SourceMatch>,
#[prost(enumeration = "traffic_match_rule::TrafficMatchMode", tag = "14")]
pub match_mode: i32,
}
pub mod traffic_match_rule {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TrafficMatchMode {
And = 0,
Or = 1,
}
impl TrafficMatchMode {
pub fn as_str_name(&self) -> &'static str {
match self {
TrafficMatchMode::And => "AND",
TrafficMatchMode::Or => "OR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AND" => Some(Self::And),
"OR" => Some(Self::Or),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LaneRule {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub group_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
#[prost(string, tag = "5")]
pub default_label_value: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub enable: bool,
#[prost(enumeration = "lane_rule::LaneMatchMode", tag = "7")]
pub match_mode: i32,
#[prost(string, tag = "8")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub etime: ::prost::alloc::string::String,
#[prost(uint32, tag = "12")]
pub priority: u32,
#[prost(string, tag = "13")]
pub description: ::prost::alloc::string::String,
}
pub mod lane_rule {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum LaneMatchMode {
Strict = 0,
Permissive = 1,
}
impl LaneMatchMode {
pub fn as_str_name(&self) -> &'static str {
match self {
LaneMatchMode::Strict => "STRICT",
LaneMatchMode::Permissive => "PERMISSIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STRICT" => Some(Self::Strict),
"PERMISSIVE" => Some(Self::Permissive),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LosslessRule {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub mtime: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub lossless_online: ::core::option::Option<LosslessOnline>,
#[prost(message, optional, tag = "8")]
pub lossless_offline: ::core::option::Option<LosslessOffline>,
#[prost(map = "string, string", tag = "9")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "30")]
pub editable: bool,
#[prost(bool, tag = "31")]
pub deleteable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LosslessOnline {
#[prost(message, optional, tag = "1")]
pub delay_register: ::core::option::Option<DelayRegister>,
#[prost(message, optional, tag = "2")]
pub warmup: ::core::option::Option<Warmup>,
#[prost(message, optional, tag = "3")]
pub readiness: ::core::option::Option<Readiness>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DelayRegister {
#[prost(bool, tag = "1")]
pub enable: bool,
#[prost(enumeration = "delay_register::DelayStrategy", tag = "2")]
pub strategy: i32,
#[prost(int32, tag = "3")]
pub interval_second: i32,
#[prost(string, tag = "4")]
pub health_check_protocol: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub health_check_method: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub health_check_path: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub health_check_interval_second: ::prost::alloc::string::String,
}
pub mod delay_register {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DelayStrategy {
DelayByTime = 0,
DelayByHealthCheck = 1,
}
impl DelayStrategy {
pub fn as_str_name(&self) -> &'static str {
match self {
DelayStrategy::DelayByTime => "DELAY_BY_TIME",
DelayStrategy::DelayByHealthCheck => "DELAY_BY_HEALTH_CHECK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DELAY_BY_TIME" => Some(Self::DelayByTime),
"DELAY_BY_HEALTH_CHECK" => Some(Self::DelayByHealthCheck),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Warmup {
#[prost(bool, tag = "1")]
pub enable: bool,
#[prost(int32, tag = "2")]
pub interval_second: i32,
#[prost(bool, tag = "3")]
pub enable_overload_protection: bool,
#[prost(int32, tag = "4")]
pub overload_protection_threshold: i32,
#[prost(int32, tag = "5")]
pub curvature: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Readiness {
#[prost(bool, tag = "1")]
pub enable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LosslessOffline {
#[prost(bool, tag = "1")]
pub enable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub client: ::core::option::Option<Client>,
#[prost(message, optional, tag = "4")]
pub namespace: ::core::option::Option<Namespace>,
#[prost(message, optional, tag = "5")]
pub service: ::core::option::Option<Service>,
#[prost(message, optional, tag = "6")]
pub instance: ::core::option::Option<Instance>,
#[prost(message, optional, tag = "7")]
pub routing: ::core::option::Option<Routing>,
#[prost(message, optional, tag = "8")]
pub alias: ::core::option::Option<ServiceAlias>,
#[prost(message, optional, tag = "9")]
pub rate_limit: ::core::option::Option<Rule>,
#[prost(message, optional, tag = "10")]
pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
#[prost(message, optional, tag = "11")]
pub config_release: ::core::option::Option<ConfigRelease>,
#[prost(message, optional, tag = "19")]
pub user: ::core::option::Option<User>,
#[prost(message, optional, tag = "20")]
pub user_group: ::core::option::Option<UserGroup>,
#[prost(message, optional, tag = "21")]
pub auth_strategy: ::core::option::Option<AuthStrategy>,
#[prost(message, optional, tag = "22")]
pub relation: ::core::option::Option<UserGroupRelation>,
#[prost(message, optional, tag = "23")]
pub login_response: ::core::option::Option<LoginResponse>,
#[prost(message, optional, tag = "24")]
pub modify_auth_strategy: ::core::option::Option<ModifyAuthStrategy>,
#[prost(message, optional, tag = "25")]
pub modify_user_group: ::core::option::Option<ModifyUserGroup>,
#[prost(message, optional, tag = "26")]
pub resources: ::core::option::Option<StrategyResources>,
#[prost(message, optional, tag = "27")]
pub option_switch: ::core::option::Option<OptionSwitch>,
#[prost(message, optional, tag = "28")]
pub instance_labels: ::core::option::Option<InstanceLabels>,
#[prost(message, optional, tag = "29")]
pub data: ::core::option::Option<::prost_types::Any>,
#[prost(message, optional, tag = "30")]
pub service_contract: ::core::option::Option<ServiceContract>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchWriteResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub size: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "4")]
pub responses: ::prost::alloc::vec::Vec<Response>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchQueryResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub amount: ::core::option::Option<u32>,
#[prost(message, optional, tag = "4")]
pub size: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "5")]
pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
#[prost(message, repeated, tag = "6")]
pub services: ::prost::alloc::vec::Vec<Service>,
#[prost(message, repeated, tag = "7")]
pub instances: ::prost::alloc::vec::Vec<Instance>,
#[prost(message, repeated, tag = "8")]
pub routings: ::prost::alloc::vec::Vec<Routing>,
#[prost(message, repeated, tag = "9")]
pub aliases: ::prost::alloc::vec::Vec<ServiceAlias>,
#[prost(message, repeated, tag = "10")]
pub rate_limits: ::prost::alloc::vec::Vec<Rule>,
#[prost(message, repeated, tag = "11")]
pub config_with_services: ::prost::alloc::vec::Vec<ConfigWithService>,
#[prost(message, repeated, tag = "18")]
pub users: ::prost::alloc::vec::Vec<User>,
#[prost(message, repeated, tag = "19")]
pub user_groups: ::prost::alloc::vec::Vec<UserGroup>,
#[prost(message, repeated, tag = "20")]
pub auth_strategies: ::prost::alloc::vec::Vec<AuthStrategy>,
#[prost(message, repeated, tag = "21")]
pub clients: ::prost::alloc::vec::Vec<Client>,
#[prost(message, repeated, tag = "22")]
pub data: ::prost::alloc::vec::Vec<::prost_types::Any>,
#[prost(message, optional, tag = "23")]
pub summary: ::core::option::Option<Summary>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverResponse {
#[prost(message, optional, tag = "1")]
pub code: ::core::option::Option<u32>,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "discover_response::DiscoverResponseType", tag = "3")]
pub r#type: i32,
#[prost(message, optional, tag = "4")]
pub service: ::core::option::Option<Service>,
#[prost(message, repeated, tag = "5")]
pub instances: ::prost::alloc::vec::Vec<Instance>,
#[prost(message, optional, tag = "6")]
pub routing: ::core::option::Option<Routing>,
#[prost(message, optional, tag = "7")]
pub rate_limit: ::core::option::Option<RateLimit>,
#[prost(message, optional, tag = "8")]
pub circuit_breaker: ::core::option::Option<CircuitBreaker>,
#[prost(message, repeated, tag = "9")]
pub services: ::prost::alloc::vec::Vec<Service>,
#[prost(message, repeated, tag = "10")]
pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
#[prost(message, optional, tag = "11")]
pub fault_detector: ::core::option::Option<FaultDetector>,
#[prost(message, optional, tag = "21")]
pub alias_for: ::core::option::Option<Service>,
#[prost(message, repeated, tag = "22")]
pub lanes: ::prost::alloc::vec::Vec<LaneGroup>,
#[prost(message, repeated, tag = "23")]
pub custom_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
#[prost(message, repeated, tag = "24")]
pub nearby_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
#[prost(message, repeated, tag = "25")]
pub lossless_rules: ::prost::alloc::vec::Vec<LosslessRule>,
}
pub mod discover_response {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DiscoverResponseType {
Unknown = 0,
Instance = 1,
Cluster = 2,
Routing = 3,
RateLimit = 4,
CircuitBreaker = 5,
Services = 6,
Namespaces = 12,
FaultDetector = 13,
Lane = 100,
CustomRouteRule = 101,
NearbyRouteRule = 102,
Lossless = 103,
}
impl DiscoverResponseType {
pub fn as_str_name(&self) -> &'static str {
match self {
DiscoverResponseType::Unknown => "UNKNOWN",
DiscoverResponseType::Instance => "INSTANCE",
DiscoverResponseType::Cluster => "CLUSTER",
DiscoverResponseType::Routing => "ROUTING",
DiscoverResponseType::RateLimit => "RATE_LIMIT",
DiscoverResponseType::CircuitBreaker => "CIRCUIT_BREAKER",
DiscoverResponseType::Services => "SERVICES",
DiscoverResponseType::Namespaces => "NAMESPACES",
DiscoverResponseType::FaultDetector => "FAULT_DETECTOR",
DiscoverResponseType::Lane => "LANE",
DiscoverResponseType::CustomRouteRule => "CUSTOM_ROUTE_RULE",
DiscoverResponseType::NearbyRouteRule => "NEARBY_ROUTE_RULE",
DiscoverResponseType::Lossless => "LOSSLESS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"INSTANCE" => Some(Self::Instance),
"CLUSTER" => Some(Self::Cluster),
"ROUTING" => Some(Self::Routing),
"RATE_LIMIT" => Some(Self::RateLimit),
"CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
"SERVICES" => Some(Self::Services),
"NAMESPACES" => Some(Self::Namespaces),
"FAULT_DETECTOR" => Some(Self::FaultDetector),
"LANE" => Some(Self::Lane),
"CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
"NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
"LOSSLESS" => Some(Self::Lossless),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptionSwitch {
#[prost(map = "string, string", tag = "1")]
pub options: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstanceLabels {
#[prost(map = "string, message", tag = "1")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, StringList>,
#[prost(string, tag = "2")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub service_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatRecord {
#[prost(string, tag = "1")]
pub instance_id: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub last_heartbeat_sec: i64,
#[prost(bool, tag = "7")]
pub exist: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstanceHeartbeat {
#[prost(string, tag = "1")]
pub instance_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub host: ::prost::alloc::string::String,
#[prost(uint32, tag = "5")]
pub port: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatsRequest {
#[prost(message, repeated, tag = "1")]
pub heartbeats: ::prost::alloc::vec::Vec<InstanceHeartbeat>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatsResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetHeartbeatsRequest {
#[prost(string, repeated, tag = "1")]
pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetHeartbeatsResponse {
#[prost(message, repeated, tag = "1")]
pub records: ::prost::alloc::vec::Vec<HeartbeatRecord>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DelHeartbeatsRequest {
#[prost(string, repeated, tag = "1")]
pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DelHeartbeatsResponse {
#[prost(uint32, tag = "1")]
pub code: u32,
#[prost(string, tag = "2")]
pub info: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverFilter {
#[prost(bool, tag = "1")]
pub only_healthy_instance: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverRequest {
#[prost(enumeration = "discover_request::DiscoverRequestType", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub service: ::core::option::Option<Service>,
#[prost(message, optional, tag = "30")]
pub filter: ::core::option::Option<DiscoverFilter>,
}
pub mod discover_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DiscoverRequestType {
Unknown = 0,
Instance = 1,
Cluster = 2,
Routing = 3,
RateLimit = 4,
CircuitBreaker = 5,
Services = 6,
Namespaces = 12,
FaultDetector = 13,
Lane = 100,
CustomRouteRule = 101,
NearbyRouteRule = 102,
Lossless = 103,
}
impl DiscoverRequestType {
pub fn as_str_name(&self) -> &'static str {
match self {
DiscoverRequestType::Unknown => "UNKNOWN",
DiscoverRequestType::Instance => "INSTANCE",
DiscoverRequestType::Cluster => "CLUSTER",
DiscoverRequestType::Routing => "ROUTING",
DiscoverRequestType::RateLimit => "RATE_LIMIT",
DiscoverRequestType::CircuitBreaker => "CIRCUIT_BREAKER",
DiscoverRequestType::Services => "SERVICES",
DiscoverRequestType::Namespaces => "NAMESPACES",
DiscoverRequestType::FaultDetector => "FAULT_DETECTOR",
DiscoverRequestType::Lane => "LANE",
DiscoverRequestType::CustomRouteRule => "CUSTOM_ROUTE_RULE",
DiscoverRequestType::NearbyRouteRule => "NEARBY_ROUTE_RULE",
DiscoverRequestType::Lossless => "LOSSLESS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"INSTANCE" => Some(Self::Instance),
"CLUSTER" => Some(Self::Cluster),
"ROUTING" => Some(Self::Routing),
"RATE_LIMIT" => Some(Self::RateLimit),
"CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
"SERVICES" => Some(Self::Services),
"NAMESPACES" => Some(Self::Namespaces),
"FAULT_DETECTOR" => Some(Self::FaultDetector),
"LANE" => Some(Self::Lane),
"CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
"NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
"LOSSLESS" => Some(Self::Lossless),
_ => None,
}
}
}
}
pub mod polaris_grpc_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 PolarisGrpcClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PolarisGrpcClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PolarisGrpcClient<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,
) -> PolarisGrpcClient<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,
{
PolarisGrpcClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn report_client(
&mut self,
request: impl tonic::IntoRequest<super::Client>,
) -> std::result::Result<tonic::Response<super::Response>, 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(
"/v1.PolarisGRPC/ReportClient",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisGRPC", "ReportClient"));
self.inner.unary(req, path, codec).await
}
pub async fn register_instance(
&mut self,
request: impl tonic::IntoRequest<super::Instance>,
) -> std::result::Result<tonic::Response<super::Response>, 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(
"/v1.PolarisGRPC/RegisterInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisGRPC", "RegisterInstance"));
self.inner.unary(req, path, codec).await
}
pub async fn deregister_instance(
&mut self,
request: impl tonic::IntoRequest<super::Instance>,
) -> std::result::Result<tonic::Response<super::Response>, 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(
"/v1.PolarisGRPC/DeregisterInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisGRPC", "DeregisterInstance"));
self.inner.unary(req, path, codec).await
}
pub async fn discover(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::DiscoverRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DiscoverResponse>>,
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("/v1.PolarisGRPC/Discover");
let mut req = request.into_streaming_request();
req.extensions_mut().insert(GrpcMethod::new("v1.PolarisGRPC", "Discover"));
self.inner.streaming(req, path, codec).await
}
pub async fn heartbeat(
&mut self,
request: impl tonic::IntoRequest<super::Instance>,
) -> std::result::Result<tonic::Response<super::Response>, 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("/v1.PolarisGRPC/Heartbeat");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("v1.PolarisGRPC", "Heartbeat"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod polaris_heartbeat_grpc_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 PolarisHeartbeatGrpcClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PolarisHeartbeatGrpcClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PolarisHeartbeatGrpcClient<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,
) -> PolarisHeartbeatGrpcClient<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,
{
PolarisHeartbeatGrpcClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn batch_heartbeat(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::HeartbeatsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::HeartbeatsResponse>>,
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(
"/v1.PolarisHeartbeatGRPC/BatchHeartbeat",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchHeartbeat"));
self.inner.streaming(req, path, codec).await
}
pub async fn batch_get_heartbeat(
&mut self,
request: impl tonic::IntoRequest<super::GetHeartbeatsRequest>,
) -> std::result::Result<
tonic::Response<super::GetHeartbeatsResponse>,
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(
"/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchGetHeartbeat"));
self.inner.unary(req, path, codec).await
}
pub async fn batch_del_heartbeat(
&mut self,
request: impl tonic::IntoRequest<super::DelHeartbeatsRequest>,
) -> std::result::Result<
tonic::Response<super::DelHeartbeatsResponse>,
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(
"/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchDelHeartbeat"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod polaris_service_contract_grpc_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 PolarisServiceContractGrpcClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PolarisServiceContractGrpcClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PolarisServiceContractGrpcClient<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,
) -> PolarisServiceContractGrpcClient<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,
{
PolarisServiceContractGrpcClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn report_service_contract(
&mut self,
request: impl tonic::IntoRequest<super::ServiceContract>,
) -> std::result::Result<tonic::Response<super::Response>, 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(
"/v1.PolarisServiceContractGRPC/ReportServiceContract",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"v1.PolarisServiceContractGRPC",
"ReportServiceContract",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_service_contract(
&mut self,
request: impl tonic::IntoRequest<super::ServiceContract>,
) -> std::result::Result<tonic::Response<super::Response>, 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(
"/v1.PolarisServiceContractGRPC/GetServiceContract",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"v1.PolarisServiceContractGRPC",
"GetServiceContract",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod polaris_grpc_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait PolarisGrpc: Send + Sync + 'static {
async fn report_client(
&self,
request: tonic::Request<super::Client>,
) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
async fn register_instance(
&self,
request: tonic::Request<super::Instance>,
) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
async fn deregister_instance(
&self,
request: tonic::Request<super::Instance>,
) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
type DiscoverStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::DiscoverResponse, tonic::Status>,
>
+ Send
+ 'static;
async fn discover(
&self,
request: tonic::Request<tonic::Streaming<super::DiscoverRequest>>,
) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
async fn heartbeat(
&self,
request: tonic::Request<super::Instance>,
) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
}
#[derive(Debug)]
pub struct PolarisGrpcServer<T: PolarisGrpc> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: PolarisGrpc> PolarisGrpcServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for PolarisGrpcServer<T>
where
T: PolarisGrpc,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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 {
let inner = self.inner.clone();
match req.uri().path() {
"/v1.PolarisGRPC/ReportClient" => {
#[allow(non_camel_case_types)]
struct ReportClientSvc<T: PolarisGrpc>(pub Arc<T>);
impl<T: PolarisGrpc> tonic::server::UnaryService<super::Client>
for ReportClientSvc<T> {
type Response = super::Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Client>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisGrpc>::report_client(&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 inner = inner.0;
let method = ReportClientSvc(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)
}
"/v1.PolarisGRPC/RegisterInstance" => {
#[allow(non_camel_case_types)]
struct RegisterInstanceSvc<T: PolarisGrpc>(pub Arc<T>);
impl<T: PolarisGrpc> tonic::server::UnaryService<super::Instance>
for RegisterInstanceSvc<T> {
type Response = super::Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Instance>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisGrpc>::register_instance(&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 inner = inner.0;
let method = RegisterInstanceSvc(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)
}
"/v1.PolarisGRPC/DeregisterInstance" => {
#[allow(non_camel_case_types)]
struct DeregisterInstanceSvc<T: PolarisGrpc>(pub Arc<T>);
impl<T: PolarisGrpc> tonic::server::UnaryService<super::Instance>
for DeregisterInstanceSvc<T> {
type Response = super::Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Instance>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisGrpc>::deregister_instance(&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 inner = inner.0;
let method = DeregisterInstanceSvc(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)
}
"/v1.PolarisGRPC/Discover" => {
#[allow(non_camel_case_types)]
struct DiscoverSvc<T: PolarisGrpc>(pub Arc<T>);
impl<
T: PolarisGrpc,
> tonic::server::StreamingService<super::DiscoverRequest>
for DiscoverSvc<T> {
type Response = super::DiscoverResponse;
type ResponseStream = T::DiscoverStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::DiscoverRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisGrpc>::discover(&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 inner = inner.0;
let method = DiscoverSvc(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)
}
"/v1.PolarisGRPC/Heartbeat" => {
#[allow(non_camel_case_types)]
struct HeartbeatSvc<T: PolarisGrpc>(pub Arc<T>);
impl<T: PolarisGrpc> tonic::server::UnaryService<super::Instance>
for HeartbeatSvc<T> {
type Response = super::Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Instance>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisGrpc>::heartbeat(&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 inner = inner.0;
let method = HeartbeatSvc(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 {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: PolarisGrpc> Clone for PolarisGrpcServer<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,
}
}
}
impl<T: PolarisGrpc> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: PolarisGrpc> tonic::server::NamedService for PolarisGrpcServer<T> {
const NAME: &'static str = "v1.PolarisGRPC";
}
}
pub mod polaris_heartbeat_grpc_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait PolarisHeartbeatGrpc: Send + Sync + 'static {
type BatchHeartbeatStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::HeartbeatsResponse, tonic::Status>,
>
+ Send
+ 'static;
async fn batch_heartbeat(
&self,
request: tonic::Request<tonic::Streaming<super::HeartbeatsRequest>>,
) -> std::result::Result<
tonic::Response<Self::BatchHeartbeatStream>,
tonic::Status,
>;
async fn batch_get_heartbeat(
&self,
request: tonic::Request<super::GetHeartbeatsRequest>,
) -> std::result::Result<
tonic::Response<super::GetHeartbeatsResponse>,
tonic::Status,
>;
async fn batch_del_heartbeat(
&self,
request: tonic::Request<super::DelHeartbeatsRequest>,
) -> std::result::Result<
tonic::Response<super::DelHeartbeatsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct PolarisHeartbeatGrpcServer<T: PolarisHeartbeatGrpc> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: PolarisHeartbeatGrpc> PolarisHeartbeatGrpcServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for PolarisHeartbeatGrpcServer<T>
where
T: PolarisHeartbeatGrpc,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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 {
let inner = self.inner.clone();
match req.uri().path() {
"/v1.PolarisHeartbeatGRPC/BatchHeartbeat" => {
#[allow(non_camel_case_types)]
struct BatchHeartbeatSvc<T: PolarisHeartbeatGrpc>(pub Arc<T>);
impl<
T: PolarisHeartbeatGrpc,
> tonic::server::StreamingService<super::HeartbeatsRequest>
for BatchHeartbeatSvc<T> {
type Response = super::HeartbeatsResponse;
type ResponseStream = T::BatchHeartbeatStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::HeartbeatsRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisHeartbeatGrpc>::batch_heartbeat(
&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 inner = inner.0;
let method = BatchHeartbeatSvc(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)
}
"/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat" => {
#[allow(non_camel_case_types)]
struct BatchGetHeartbeatSvc<T: PolarisHeartbeatGrpc>(pub Arc<T>);
impl<
T: PolarisHeartbeatGrpc,
> tonic::server::UnaryService<super::GetHeartbeatsRequest>
for BatchGetHeartbeatSvc<T> {
type Response = super::GetHeartbeatsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetHeartbeatsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisHeartbeatGrpc>::batch_get_heartbeat(
&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 inner = inner.0;
let method = BatchGetHeartbeatSvc(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)
}
"/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat" => {
#[allow(non_camel_case_types)]
struct BatchDelHeartbeatSvc<T: PolarisHeartbeatGrpc>(pub Arc<T>);
impl<
T: PolarisHeartbeatGrpc,
> tonic::server::UnaryService<super::DelHeartbeatsRequest>
for BatchDelHeartbeatSvc<T> {
type Response = super::DelHeartbeatsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DelHeartbeatsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisHeartbeatGrpc>::batch_del_heartbeat(
&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 inner = inner.0;
let method = BatchDelHeartbeatSvc(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 {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: PolarisHeartbeatGrpc> Clone for PolarisHeartbeatGrpcServer<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,
}
}
}
impl<T: PolarisHeartbeatGrpc> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: PolarisHeartbeatGrpc> tonic::server::NamedService
for PolarisHeartbeatGrpcServer<T> {
const NAME: &'static str = "v1.PolarisHeartbeatGRPC";
}
}
pub mod polaris_service_contract_grpc_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait PolarisServiceContractGrpc: Send + Sync + 'static {
async fn report_service_contract(
&self,
request: tonic::Request<super::ServiceContract>,
) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
async fn get_service_contract(
&self,
request: tonic::Request<super::ServiceContract>,
) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
}
#[derive(Debug)]
pub struct PolarisServiceContractGrpcServer<T: PolarisServiceContractGrpc> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: PolarisServiceContractGrpc> PolarisServiceContractGrpcServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for PolarisServiceContractGrpcServer<T>
where
T: PolarisServiceContractGrpc,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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 {
let inner = self.inner.clone();
match req.uri().path() {
"/v1.PolarisServiceContractGRPC/ReportServiceContract" => {
#[allow(non_camel_case_types)]
struct ReportServiceContractSvc<T: PolarisServiceContractGrpc>(
pub Arc<T>,
);
impl<
T: PolarisServiceContractGrpc,
> tonic::server::UnaryService<super::ServiceContract>
for ReportServiceContractSvc<T> {
type Response = super::Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ServiceContract>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisServiceContractGrpc>::report_service_contract(
&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 inner = inner.0;
let method = ReportServiceContractSvc(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)
}
"/v1.PolarisServiceContractGRPC/GetServiceContract" => {
#[allow(non_camel_case_types)]
struct GetServiceContractSvc<T: PolarisServiceContractGrpc>(
pub Arc<T>,
);
impl<
T: PolarisServiceContractGrpc,
> tonic::server::UnaryService<super::ServiceContract>
for GetServiceContractSvc<T> {
type Response = super::Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ServiceContract>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisServiceContractGrpc>::get_service_contract(
&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 inner = inner.0;
let method = GetServiceContractSvc(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 {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: PolarisServiceContractGrpc> Clone for PolarisServiceContractGrpcServer<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,
}
}
}
impl<T: PolarisServiceContractGrpc> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: PolarisServiceContractGrpc> tonic::server::NamedService
for PolarisServiceContractGrpcServer<T> {
const NAME: &'static str = "v1.PolarisServiceContractGRPC";
}
}
pub mod polaris_config_grpc_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 PolarisConfigGrpcClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PolarisConfigGrpcClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PolarisConfigGrpcClient<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,
) -> PolarisConfigGrpcClient<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,
{
PolarisConfigGrpcClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_config_file(
&mut self,
request: impl tonic::IntoRequest<super::ClientConfigFileInfo>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
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(
"/v1.PolarisConfigGRPC/GetConfigFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisConfigGRPC", "GetConfigFile"));
self.inner.unary(req, path, codec).await
}
pub async fn create_config_file(
&mut self,
request: impl tonic::IntoRequest<super::ConfigFile>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
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(
"/v1.PolarisConfigGRPC/CreateConfigFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisConfigGRPC", "CreateConfigFile"));
self.inner.unary(req, path, codec).await
}
pub async fn update_config_file(
&mut self,
request: impl tonic::IntoRequest<super::ConfigFile>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
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(
"/v1.PolarisConfigGRPC/UpdateConfigFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisConfigGRPC", "UpdateConfigFile"));
self.inner.unary(req, path, codec).await
}
pub async fn publish_config_file(
&mut self,
request: impl tonic::IntoRequest<super::ConfigFileRelease>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
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(
"/v1.PolarisConfigGRPC/PublishConfigFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisConfigGRPC", "PublishConfigFile"));
self.inner.unary(req, path, codec).await
}
pub async fn upsert_and_publish_config_file(
&mut self,
request: impl tonic::IntoRequest<super::ConfigFilePublishInfo>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
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(
"/v1.PolarisConfigGRPC/UpsertAndPublishConfigFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("v1.PolarisConfigGRPC", "UpsertAndPublishConfigFile"),
);
self.inner.unary(req, path, codec).await
}
pub async fn watch_config_files(
&mut self,
request: impl tonic::IntoRequest<super::ClientWatchConfigFileRequest>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
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(
"/v1.PolarisConfigGRPC/WatchConfigFiles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisConfigGRPC", "WatchConfigFiles"));
self.inner.unary(req, path, codec).await
}
pub async fn get_config_file_metadata_list(
&mut self,
request: impl tonic::IntoRequest<super::ConfigFileGroupRequest>,
) -> std::result::Result<
tonic::Response<super::ConfigClientListResponse>,
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(
"/v1.PolarisConfigGRPC/GetConfigFileMetadataList",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("v1.PolarisConfigGRPC", "GetConfigFileMetadataList"),
);
self.inner.unary(req, path, codec).await
}
pub async fn discover(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::ConfigDiscoverRequest,
>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ConfigDiscoverResponse>>,
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(
"/v1.PolarisConfigGRPC/Discover",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("v1.PolarisConfigGRPC", "Discover"));
self.inner.streaming(req, path, codec).await
}
}
}
pub mod polaris_config_grpc_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait PolarisConfigGrpc: Send + Sync + 'static {
async fn get_config_file(
&self,
request: tonic::Request<super::ClientConfigFileInfo>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
tonic::Status,
>;
async fn create_config_file(
&self,
request: tonic::Request<super::ConfigFile>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
tonic::Status,
>;
async fn update_config_file(
&self,
request: tonic::Request<super::ConfigFile>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
tonic::Status,
>;
async fn publish_config_file(
&self,
request: tonic::Request<super::ConfigFileRelease>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
tonic::Status,
>;
async fn upsert_and_publish_config_file(
&self,
request: tonic::Request<super::ConfigFilePublishInfo>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
tonic::Status,
>;
async fn watch_config_files(
&self,
request: tonic::Request<super::ClientWatchConfigFileRequest>,
) -> std::result::Result<
tonic::Response<super::ConfigClientResponse>,
tonic::Status,
>;
async fn get_config_file_metadata_list(
&self,
request: tonic::Request<super::ConfigFileGroupRequest>,
) -> std::result::Result<
tonic::Response<super::ConfigClientListResponse>,
tonic::Status,
>;
type DiscoverStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ConfigDiscoverResponse, tonic::Status>,
>
+ Send
+ 'static;
async fn discover(
&self,
request: tonic::Request<tonic::Streaming<super::ConfigDiscoverRequest>>,
) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct PolarisConfigGrpcServer<T: PolarisConfigGrpc> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: PolarisConfigGrpc> PolarisConfigGrpcServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for PolarisConfigGrpcServer<T>
where
T: PolarisConfigGrpc,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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 {
let inner = self.inner.clone();
match req.uri().path() {
"/v1.PolarisConfigGRPC/GetConfigFile" => {
#[allow(non_camel_case_types)]
struct GetConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ClientConfigFileInfo>
for GetConfigFileSvc<T> {
type Response = super::ConfigClientResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ClientConfigFileInfo>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::get_config_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 inner = inner.0;
let method = GetConfigFileSvc(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)
}
"/v1.PolarisConfigGRPC/CreateConfigFile" => {
#[allow(non_camel_case_types)]
struct CreateConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ConfigFile>
for CreateConfigFileSvc<T> {
type Response = super::ConfigClientResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ConfigFile>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::create_config_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 inner = inner.0;
let method = CreateConfigFileSvc(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)
}
"/v1.PolarisConfigGRPC/UpdateConfigFile" => {
#[allow(non_camel_case_types)]
struct UpdateConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ConfigFile>
for UpdateConfigFileSvc<T> {
type Response = super::ConfigClientResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ConfigFile>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::update_config_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 inner = inner.0;
let method = UpdateConfigFileSvc(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)
}
"/v1.PolarisConfigGRPC/PublishConfigFile" => {
#[allow(non_camel_case_types)]
struct PublishConfigFileSvc<T: PolarisConfigGrpc>(pub Arc<T>);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ConfigFileRelease>
for PublishConfigFileSvc<T> {
type Response = super::ConfigClientResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ConfigFileRelease>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::publish_config_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 inner = inner.0;
let method = PublishConfigFileSvc(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)
}
"/v1.PolarisConfigGRPC/UpsertAndPublishConfigFile" => {
#[allow(non_camel_case_types)]
struct UpsertAndPublishConfigFileSvc<T: PolarisConfigGrpc>(
pub Arc<T>,
);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ConfigFilePublishInfo>
for UpsertAndPublishConfigFileSvc<T> {
type Response = super::ConfigClientResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ConfigFilePublishInfo>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::upsert_and_publish_config_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 inner = inner.0;
let method = UpsertAndPublishConfigFileSvc(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)
}
"/v1.PolarisConfigGRPC/WatchConfigFiles" => {
#[allow(non_camel_case_types)]
struct WatchConfigFilesSvc<T: PolarisConfigGrpc>(pub Arc<T>);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ClientWatchConfigFileRequest>
for WatchConfigFilesSvc<T> {
type Response = super::ConfigClientResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ClientWatchConfigFileRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::watch_config_files(
&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 inner = inner.0;
let method = WatchConfigFilesSvc(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)
}
"/v1.PolarisConfigGRPC/GetConfigFileMetadataList" => {
#[allow(non_camel_case_types)]
struct GetConfigFileMetadataListSvc<T: PolarisConfigGrpc>(
pub Arc<T>,
);
impl<
T: PolarisConfigGrpc,
> tonic::server::UnaryService<super::ConfigFileGroupRequest>
for GetConfigFileMetadataListSvc<T> {
type Response = super::ConfigClientListResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ConfigFileGroupRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::get_config_file_metadata_list(
&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 inner = inner.0;
let method = GetConfigFileMetadataListSvc(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)
}
"/v1.PolarisConfigGRPC/Discover" => {
#[allow(non_camel_case_types)]
struct DiscoverSvc<T: PolarisConfigGrpc>(pub Arc<T>);
impl<
T: PolarisConfigGrpc,
> tonic::server::StreamingService<super::ConfigDiscoverRequest>
for DiscoverSvc<T> {
type Response = super::ConfigDiscoverResponse;
type ResponseStream = T::DiscoverStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::ConfigDiscoverRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PolarisConfigGrpc>::discover(&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 inner = inner.0;
let method = DiscoverSvc(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)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: PolarisConfigGrpc> Clone for PolarisConfigGrpcServer<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,
}
}
}
impl<T: PolarisConfigGrpc> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: PolarisConfigGrpc> tonic::server::NamedService
for PolarisConfigGrpcServer<T> {
const NAME: &'static str = "v1.PolarisConfigGRPC";
}
}