#[non_exhaustive]pub struct ServiceDescriptor {
pub k8s_pod_name: String,
pub k8s_namespace_name: String,
pub k8s_cluster_name: String,
pub deployment_environment: String,
pub service_name: String,
}Expand description
Information about the service.
This information is initially filled as follows:
- Fields will be attempted to fetch from environment variables.
- If not found, a default values will be chosen.
For environment variable names and default values, see the constants in the struct.
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.k8s_pod_name: StringName of the k8s pod.
k8s_namespace_name: StringName of the k8s namespace.
k8s_cluster_name: StringName of the k8s cluster.
deployment_environment: StringName of the deployment environment. Note that the single deployment environment can be spread among multiple clusters.
service_name: StringName of the service.
Implementations§
Source§impl ServiceDescriptor
impl ServiceDescriptor
Sourcepub const K8S_POD_NAME_ENV_VAR: &'static str = "POD_NAME"
pub const K8S_POD_NAME_ENV_VAR: &'static str = "POD_NAME"
Environment variable to fetch the k8s pod name.
Sourcepub const K8S_NAMESPACE_NAME_ENV_VAR: &'static str = "POD_NAMESPACE"
pub const K8S_NAMESPACE_NAME_ENV_VAR: &'static str = "POD_NAMESPACE"
Environment variable to fetch the k8s namespace name.
Sourcepub const K8S_CLUSTER_NAME_ENV_VAR: &'static str = "CLUSTER_NAME"
pub const K8S_CLUSTER_NAME_ENV_VAR: &'static str = "CLUSTER_NAME"
Environment variable to fetch the k8s cluster name.
Sourcepub const DEPLOYMENT_ENVIRONMENT_ENV_VAR: &'static str = "DEPLOYMENT_ENVIRONMENT"
pub const DEPLOYMENT_ENVIRONMENT_ENV_VAR: &'static str = "DEPLOYMENT_ENVIRONMENT"
Environment variable to fetch the deployment environment.
Sourcepub const SERVICE_NAME_ENV_VAR: &'static str = "SERVICE_NAME"
pub const SERVICE_NAME_ENV_VAR: &'static str = "SERVICE_NAME"
Environment variable to fetch the service name.
Sourcepub const DEFAULT_K8S_POD_NAME: &'static str = "wire_framework-0"
pub const DEFAULT_K8S_POD_NAME: &'static str = "wire_framework-0"
Default value for the k8s pod name.
Sourcepub const DEFAULT_K8S_NAMESPACE_NAME: &'static str = "local"
pub const DEFAULT_K8S_NAMESPACE_NAME: &'static str = "local"
Default value for the k8s namespace name.
Sourcepub const DEFAULT_K8S_CLUSTER_NAME: &'static str = "local"
pub const DEFAULT_K8S_CLUSTER_NAME: &'static str = "local"
Default value for the k8s cluster name.
Sourcepub const DEFAULT_DEPLOYMENT_ENVIRONMENT: &'static str = "local"
pub const DEFAULT_DEPLOYMENT_ENVIRONMENT: &'static str = "local"
Default value for the deployment environment.
Sourcepub const DEFAULT_SERVICE_NAME: &'static str = "wire_framework"
pub const DEFAULT_SERVICE_NAME: &'static str = "wire_framework"
Default value for the service name.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a filled ServiceDescriptor object.
Fetched fields can be overridden.
pub fn with_k8s_pod_name(self, k8s_pod_name: Option<String>) -> Self
pub fn with_k8s_namespace_name(self, k8s_namespace_name: Option<String>) -> Self
pub fn with_service_name(self, service_name: Option<String>) -> Self
Trait Implementations§
Source§impl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
Source§fn clone(&self) -> ServiceDescriptor
fn clone(&self) -> ServiceDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more