⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ServiceRegistry

Struct ServiceRegistry 

Source
pub struct ServiceRegistry { /* private fields */ }
Expand description

Service registry and discovery.

Implementations§

Source§

impl ServiceRegistry

Source

pub fn new() -> Self

Create a new service registry.

Source

pub fn with_domain(domain: String) -> Self

Create with a custom domain.

Source

pub fn register(&mut self, entry: ServiceEntry) -> Result<(), DiscoveryError>

Register a new service.

Source

pub fn deregister( &mut self, name: &str, namespace: &str, ) -> Result<ServiceEntry, DiscoveryError>

Deregister a service.

Source

pub fn lookup( &self, name: &str, namespace: &str, ) -> Result<&ServiceEntry, DiscoveryError>

Look up a service by name and namespace.

Source

pub fn list(&self, namespace_filter: Option<&str>) -> Vec<&ServiceEntry>

List all services, optionally filtered by namespace.

Source

pub fn resolve_service_dns( &self, dns_name: &str, ) -> Result<&ServiceEntry, DiscoveryError>

Resolve a Kubernetes-style DNS name to service endpoints.

Format: name.namespace.svc.cluster.local

Source

pub fn fqdn(&self, name: &str, namespace: &str) -> String

Get the fully qualified DNS name for a service.

Source

pub fn healthy_endpoints( &self, name: &str, namespace: &str, ) -> Result<Vec<&ServiceEndpoint>, DiscoveryError>

Get healthy endpoints for a service.

Source

pub fn update_endpoint_health( &mut self, name: &str, namespace: &str, address: &str, healthy: bool, ) -> Result<(), DiscoveryError>

Update endpoint health for a service.

Source

pub fn service_count(&self) -> usize

Get the total number of registered services.

Trait Implementations§

Source§

impl Debug for ServiceRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServiceRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for ServiceRegistry

§

impl RefUnwindSafe for ServiceRegistry

§

impl Send for ServiceRegistry

§

impl Sync for ServiceRegistry

§

impl Unpin for ServiceRegistry

§

impl UnwindSafe for ServiceRegistry

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.