envoy-types 0.7.3

Collection of protobuf types and other assets to work with the Envoy Proxy through Rust gRPC services.
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Config {
    /// The stat prefix for the generated stats.
    #[prost(string, tag = "1")]
    pub stat_prefix: ::prost::alloc::string::String,
    /// The histograms this logger will emit.
    #[prost(message, repeated, tag = "3")]
    pub histograms: ::prost::alloc::vec::Vec<config::Histogram>,
    /// The counters this logger will emit.
    #[prost(message, repeated, tag = "4")]
    pub counters: ::prost::alloc::vec::Vec<config::Counter>,
}
/// Nested message and enum types in `Config`.
pub mod config {
    /// Defines a tag on a stat.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Tag {
        /// The name of the tag.
        #[prost(string, tag = "1")]
        pub name: ::prost::alloc::string::String,
        /// The value of the tag, using :ref:`command operators <config_access_log_command_operators>`.
        #[prost(string, tag = "2")]
        pub value_format: ::prost::alloc::string::String,
    }
    impl ::prost::Name for Tag {
        const NAME: &'static str = "Tag";
        const PACKAGE: &'static str = "envoy.extensions.access_loggers.stats.v3";
        fn full_name() -> ::prost::alloc::string::String {
            "envoy.extensions.access_loggers.stats.v3.Config.Tag".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "type.googleapis.com/envoy.extensions.access_loggers.stats.v3.Config.Tag"
                .into()
        }
    }
    /// Defines the name and tags of a stat.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Stat {
        /// The name of the stat.
        #[prost(string, tag = "1")]
        pub name: ::prost::alloc::string::String,
        /// The tags for the stat.
        #[prost(message, repeated, tag = "2")]
        pub tags: ::prost::alloc::vec::Vec<Tag>,
    }
    impl ::prost::Name for Stat {
        const NAME: &'static str = "Stat";
        const PACKAGE: &'static str = "envoy.extensions.access_loggers.stats.v3";
        fn full_name() -> ::prost::alloc::string::String {
            "envoy.extensions.access_loggers.stats.v3.Config.Stat".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "type.googleapis.com/envoy.extensions.access_loggers.stats.v3.Config.Stat"
                .into()
        }
    }
    /// Configuration for a histogram stat.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Histogram {
        /// The name and tags of this histogram.
        #[prost(message, optional, tag = "1")]
        pub stat: ::core::option::Option<Stat>,
        /// The units for this histogram.
        #[prost(enumeration = "histogram::Unit", tag = "2")]
        pub unit: i32,
        /// The format string for the value of this histogram, using :ref:`command operators <config_access_log_command_operators>`.
        /// This must evaluate to a positive number.
        #[prost(string, tag = "3")]
        pub value_format: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `Histogram`.
    pub mod histogram {
        /// The histogram units. The units are needed for some stat sinks.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum Unit {
            Unspecified = 0,
            Bytes = 1,
            Microseconds = 2,
            Milliseconds = 3,
            /// Values are scaled to range 0-1.0, indicating 0%-100%. Values can be outside this range,
            /// but must be positive. Values extremely far out of this range may overflow.
            Percent = 4,
        }
        impl Unit {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Self::Unspecified => "Unspecified",
                    Self::Bytes => "Bytes",
                    Self::Microseconds => "Microseconds",
                    Self::Milliseconds => "Milliseconds",
                    Self::Percent => "Percent",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "Unspecified" => Some(Self::Unspecified),
                    "Bytes" => Some(Self::Bytes),
                    "Microseconds" => Some(Self::Microseconds),
                    "Milliseconds" => Some(Self::Milliseconds),
                    "Percent" => Some(Self::Percent),
                    _ => None,
                }
            }
        }
    }
    impl ::prost::Name for Histogram {
        const NAME: &'static str = "Histogram";
        const PACKAGE: &'static str = "envoy.extensions.access_loggers.stats.v3";
        fn full_name() -> ::prost::alloc::string::String {
            "envoy.extensions.access_loggers.stats.v3.Config.Histogram".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "type.googleapis.com/envoy.extensions.access_loggers.stats.v3.Config.Histogram"
                .into()
        }
    }
    /// Configuration for a counter stat.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Counter {
        /// The name and tags of this counter.
        #[prost(message, optional, tag = "1")]
        pub stat: ::core::option::Option<Stat>,
        /// The format string for the value to add to this counter, using :ref:`command operators <config_access_log_command_operators>`.
        /// One of `value_format` or `value_fixed` must be configured.
        #[prost(string, tag = "2")]
        pub value_format: ::prost::alloc::string::String,
        /// A fixed value to add to this counter.
        /// One of `value_format` or `value_fixed` must be configured.
        #[prost(message, optional, tag = "3")]
        pub value_fixed: ::core::option::Option<
            super::super::super::super::super::super::google::protobuf::UInt64Value,
        >,
    }
    impl ::prost::Name for Counter {
        const NAME: &'static str = "Counter";
        const PACKAGE: &'static str = "envoy.extensions.access_loggers.stats.v3";
        fn full_name() -> ::prost::alloc::string::String {
            "envoy.extensions.access_loggers.stats.v3.Config.Counter".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "type.googleapis.com/envoy.extensions.access_loggers.stats.v3.Config.Counter"
                .into()
        }
    }
}
impl ::prost::Name for Config {
    const NAME: &'static str = "Config";
    const PACKAGE: &'static str = "envoy.extensions.access_loggers.stats.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.extensions.access_loggers.stats.v3.Config".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.extensions.access_loggers.stats.v3.Config".into()
    }
}