pub struct BackendRule {
pub selector: String,
pub address: String,
pub deadline: f64,
pub min_deadline: f64,
pub operation_deadline: f64,
pub path_translation: i32,
pub protocol: String,
pub overrides_by_request_protocol: HashMap<String, BackendRule>,
pub authentication: Option<Authentication>,
}
Expand description
A backend rule provides configuration for an individual API element.
Fields§
§selector: String
Selects the methods to which this rule applies.
Refer to [selector][google.api.DocumentationRule.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][google.api.BackendRule.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: i32
§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][google.api.BackendRule.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
Sourcepub fn path_translation(&self) -> PathTranslation
pub fn path_translation(&self) -> PathTranslation
Returns the enum value of path_translation
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_path_translation(&mut self, value: PathTranslation)
pub fn set_path_translation(&mut self, value: PathTranslation)
Sets path_translation
to the provided enum value.
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 moreSource§impl Debug for BackendRule
impl Debug for BackendRule
Source§impl Default for BackendRule
impl Default for BackendRule
Source§fn default() -> BackendRule
fn default() -> BackendRule
Source§impl Message for BackendRule
impl Message for BackendRule
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for BackendRule
impl PartialEq for BackendRule
impl StructuralPartialEq for BackendRule
Auto Trait Implementations§
impl Freeze for BackendRule
impl RefUnwindSafe for BackendRule
impl Send for BackendRule
impl Sync for BackendRule
impl Unpin for BackendRule
impl UnwindSafe for BackendRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request