Struct junction_api::backend::Backend
source · pub struct Backend {
pub id: BackendId,
pub lb: LbPolicy,
}
Expand description
A Backend is a logical target for network traffic.
A backend configures how all traffic for it’s target
is handled. Any
traffic routed to this backend will use its load balancing policy to evenly
spread traffic across all available endpoints.
Fields§
§id: BackendId
A unique description of what this backend is.
lb: LbPolicy
How traffic to this target should be load balanced.
Implementations§
source§impl Backend
impl Backend
pub fn from_xds( cluster: &Cluster, route_action: Option<&RouteAction>, ) -> Result<Self, Error>
pub fn to_xds_cluster(&self) -> Cluster
pub fn to_xds_passthrough_route(&self) -> RouteConfiguration
source§impl Backend
impl Backend
sourcepub fn to_service_patch(&self) -> Service
pub fn to_service_patch(&self) -> Service
Generate a partial [Service] from this backend.
This service can be used to patch and overwrite an existing Service
using the kube
crate or saved as json/yaml and used to patch an
existing service with kubectl patch
.
sourcepub fn from_service(svc: &Service) -> Result<Vec<Self>, Error>
pub fn from_service(svc: &Service) -> Result<Vec<Self>, Error>
Read one or more Backends from a Kubernetes [Service]. A backend will be generated for every distinct port the [Service] is configured with.
NOTE: This method currently only supports generating backends with > Service targets. Support for DNS backends is coming soon!.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Backend
impl<'de> Deserialize<'de> for Backend
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Backend
Auto Trait Implementations§
impl Freeze for Backend
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnwindSafe for Backend
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§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