Enum junction_api::Target
source · pub enum Target {
Dns(Dns),
KubeService(KubeService),
}
Expand description
A traffic target. Traffic targets are abstract, uniquely identifiable places to route traffic, like a DNS name or a Kubernetes Service.
Variants§
Dns(Dns)
A DNS hostname.
Traffic sent to a DNS hostname will uses the addresses returned from DNS as its final destination. How addresses are fetched and load balanced is configured on each Backend.
KubeService(KubeService)
The addresses that make up a Kubernetes Service.
Any type of Service, except an ExternalName
Service may be used as a
traffic target (to represent an ExternalName
Service, use a DNS target)
and will route traffic directly to Pod IPs as if the service had
explicitly set ClusterIP: None
.
Implementations§
source§impl Target
impl Target
sourcepub fn dns(name: &str) -> Result<Self, Error>
pub fn dns(name: &str) -> Result<Self, Error>
Create a new DNS target. The given name must be a valid RFC 1123 DNS hostname.
sourcepub fn kube_service(namespace: &str, name: &str) -> Result<Self, Error>
pub fn kube_service(namespace: &str, name: &str) -> Result<Self, Error>
Create a new Kubernetes Service target.
name
and hostname
must be valid DNS subdomain labels.
sourcepub fn into_backend(self, port: u16) -> BackendId
pub fn into_backend(self, port: u16) -> BackendId
Convert this target into a BackendId with the specified port.
sourcepub fn into_vhost(self, port: Option<u16>) -> VirtualHost
pub fn into_vhost(self, port: Option<u16>) -> VirtualHost
Convert this target into a VirtualHost with an optional port.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
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>,
source§impl Ord for Target
impl Ord for Target
source§impl PartialOrd for Target
impl PartialOrd for Target
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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