#[non_exhaustive]pub struct BackendRule {
pub selector: String,
pub address: String,
pub deadline: f64,
pub min_deadline: f64,
pub operation_deadline: f64,
pub path_translation: PathTranslation,
pub protocol: String,
pub overrides_by_request_protocol: HashMap<String, BackendRule>,
pub authentication: Option<Authentication>,
/* private fields */
}
Expand description
A backend rule provides configuration for an individual API element.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.selector: String
Selects the methods to which this rule applies.
Refer to selector for syntax details.
address: String
The address of the API backend.
The scheme is used to determine the backend protocol and security. The following schemes are accepted:
SCHEME PROTOCOL SECURITY http:// HTTP None https:// HTTP TLS grpc:// gRPC None grpcs:// gRPC TLS
It is recommended to explicitly include a scheme. Leaving out the scheme may cause constrasting behaviors across platforms.
If the port is unspecified, the default is:
- 80 for schemes without TLS
- 443 for schemes with TLS
For HTTP backends, use protocol to specify the protocol version.
deadline: f64
The number of seconds to wait for a response from a request. The default varies based on the request protocol and deployment environment.
min_deadline: f64
Deprecated, do not use.
operation_deadline: f64
The number of seconds to wait for the completion of a long running operation. The default is no deadline.
path_translation: PathTranslation
§protocol: String
The protocol used for sending a request to the backend. The supported values are “http/1.1” and “h2”.
The default value is inferred from the scheme in the address field:
SCHEME PROTOCOL http:// http/1.1 https:// http/1.1 grpc:// h2 grpcs:// h2
For secure HTTP backends (https://) that support HTTP/2, set this field to “h2” for improved performance.
Configuring this field to non-default values is only supported for secure HTTP backends. This field will be ignored for all other backends.
See https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for more details on the supported values.
overrides_by_request_protocol: HashMap<String, BackendRule>
The map between request protocol and the backend address.
authentication: Option<Authentication>
Authentication settings used by the backend.
These are typically used to provide service management functionality to
a backend served on a publicly-routable URL. The authentication
details should match the authentication behavior used by the backend.
For example, specifying jwt_audience
implies that the backend expects
authentication via a JWT.
When authentication is unspecified, the resulting behavior is the same
as disable_auth
set to true
.
Refer to https://developers.google.com/identity/protocols/OpenIDConnect for JWT ID token.
Implementations§
Source§impl BackendRule
impl BackendRule
pub fn new() -> Self
Sourcepub fn set_selector<T: Into<String>>(self, v: T) -> Self
pub fn set_selector<T: Into<String>>(self, v: T) -> Self
Sets the value of selector.
Sourcepub fn set_address<T: Into<String>>(self, v: T) -> Self
pub fn set_address<T: Into<String>>(self, v: T) -> Self
Sets the value of address.
Sourcepub fn set_deadline<T: Into<f64>>(self, v: T) -> Self
pub fn set_deadline<T: Into<f64>>(self, v: T) -> Self
Sets the value of deadline.
Sourcepub fn set_min_deadline<T: Into<f64>>(self, v: T) -> Self
👎Deprecated
pub fn set_min_deadline<T: Into<f64>>(self, v: T) -> Self
Sets the value of min_deadline.
Sourcepub fn set_operation_deadline<T: Into<f64>>(self, v: T) -> Self
pub fn set_operation_deadline<T: Into<f64>>(self, v: T) -> Self
Sets the value of operation_deadline.
Sourcepub fn set_path_translation<T: Into<PathTranslation>>(self, v: T) -> Self
pub fn set_path_translation<T: Into<PathTranslation>>(self, v: T) -> Self
Sets the value of path_translation.
Sourcepub fn set_protocol<T: Into<String>>(self, v: T) -> Self
pub fn set_protocol<T: Into<String>>(self, v: T) -> Self
Sets the value of protocol.
Sourcepub fn set_overrides_by_request_protocol<T, K, V>(self, v: T) -> Self
pub fn set_overrides_by_request_protocol<T, K, V>(self, v: T) -> Self
Sets the value of overrides_by_request_protocol.
Sourcepub fn set_authentication<T: Into<Option<Authentication>>>(self, v: T) -> Self
pub fn set_authentication<T: Into<Option<Authentication>>>(self, v: T) -> Self
Sets the value of authentication.
Note that all the setters affecting authentication
are mutually
exclusive.
Sourcepub fn jwt_audience(&self) -> Option<&String>
pub fn jwt_audience(&self) -> Option<&String>
The value of authentication
if it holds a JwtAudience
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_jwt_audience<T: Into<String>>(self, v: T) -> Self
pub fn set_jwt_audience<T: Into<String>>(self, v: T) -> Self
Sets the value of authentication
to hold a JwtAudience
.
Note that all the setters affecting authentication
are
mutually exclusive.
Sourcepub fn disable_auth(&self) -> Option<&bool>
pub fn disable_auth(&self) -> Option<&bool>
The value of authentication
if it holds a DisableAuth
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_disable_auth<T: Into<bool>>(self, v: T) -> Self
pub fn set_disable_auth<T: Into<bool>>(self, v: T) -> Self
Sets the value of authentication
to hold a DisableAuth
.
Note that all the setters affecting authentication
are
mutually exclusive.
Trait Implementations§
Source§impl Clone for BackendRule
impl Clone for BackendRule
Source§fn clone(&self) -> BackendRule
fn clone(&self) -> BackendRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more