Skip to main content

KoiClient

Struct KoiClient 

Source
pub struct KoiClient { /* private fields */ }

Implementations§

Source§

impl KoiClient

Source

pub fn new(endpoint: &str) -> Self

Source

pub fn with_token(endpoint: &str, token: &str) -> Self

Create a client with a Daemon Access Token for authenticated requests.

Source

pub fn from_breadcrumb() -> Option<Self>

Create a client from the breadcrumb file (endpoint + token).

Returns None if no breadcrumb exists.

Source

pub fn health(&self) -> Result<()>

Quick health check with a 200ms timeout.

Source

pub fn register(&self, payload: &RegisterPayload) -> Result<RegistrationResult>

Source

pub fn unregister(&self, id: &str) -> Result<()>

Source

pub fn heartbeat(&self, id: &str) -> Result<RenewalResult>

Source

pub fn resolve(&self, instance: &str) -> Result<ServiceRecord>

Source

pub fn browse_stream(&self, service_type: &str) -> Result<SseStream>

Start a browse SSE stream. Returns an iterator of JSON events.

Source

pub fn events_stream(&self, service_type: &str) -> Result<SseStream>

Start an events SSE stream. Returns an iterator of JSON events.

Source

pub fn unified_status(&self) -> Result<Value>

Fetch unified status from /v1/status.

Source

pub fn dns_status(&self) -> Result<Value>

Source

pub fn dns_lookup(&self, name: &str, record_type: RecordType) -> Result<Value>

Source

pub fn dns_list(&self) -> Result<Value>

Source

pub fn dns_add(&self, name: &str, ip: &str, ttl: Option<u32>) -> Result<Value>

Source

pub fn dns_remove(&self, name: &str) -> Result<Value>

Source

pub fn dns_start(&self) -> Result<Value>

Source

pub fn dns_stop(&self) -> Result<Value>

Source

pub fn health_status(&self) -> Result<Value>

Source

pub fn health_add_check( &self, name: &str, kind: ServiceCheckKind, target: &str, interval_secs: u64, timeout_secs: u64, ) -> Result<Value>

Source

pub fn health_remove_check(&self, name: &str) -> Result<Value>

Source

pub fn proxy_status(&self) -> Result<Value>

Source

pub fn proxy_list(&self) -> Result<Value>

Source

pub fn proxy_add( &self, name: &str, listen_port: u16, backend: &str, allow_remote: bool, ) -> Result<Value>

Source

pub fn proxy_remove(&self, name: &str) -> Result<Value>

Source

pub fn udp_status(&self) -> Result<Value>

Source

pub fn udp_bind(&self, port: u16, addr: &str, lease_secs: u64) -> Result<Value>

Source

pub fn udp_unbind(&self, id: &str) -> Result<Value>

Source

pub fn udp_send(&self, id: &str, dest: &str, payload_b64: &str) -> Result<Value>

Source

pub fn udp_heartbeat(&self, id: &str) -> Result<Value>

Source

pub fn post_json(&self, path: &str, body: &Value) -> Result<Value>

POST JSON to an arbitrary path and return the response as a JSON value.

Source

pub fn get_json(&self, path: &str) -> Result<Value>

GET JSON from an arbitrary path and return the response as a JSON value.

Source

pub fn put_json(&self, path: &str, body: &Value) -> Result<Value>

PUT JSON to an arbitrary path and return the response as a JSON value.

Source

pub fn admin_status(&self) -> Result<DaemonStatus>

Source

pub fn admin_registrations(&self) -> Result<Vec<AdminRegistration>>

Source

pub fn admin_inspect(&self, id: &str) -> Result<AdminRegistration>

Source

pub fn admin_force_unregister(&self, id: &str) -> Result<()>

Source

pub fn admin_drain(&self, id: &str) -> Result<()>

Source

pub fn admin_revive(&self, id: &str) -> Result<()>

Source

pub fn shutdown(&self) -> Result<()>

Request a graceful shutdown of the running daemon.

Source

pub fn get_roster_manifest(&self) -> Result<Value>

GET /v1/certmesh/roster - fetch signed roster manifest.

Source

pub fn push_renewal( &self, member_endpoint: &str, request: &Value, ) -> Result<Value>

POST /v1/certmesh/renew - push renewed cert to a member.

member_endpoint is the member’s HTTP endpoint, not the CA’s. Used when the primary pushes renewals to remote members.

Source

pub fn health_heartbeat(&self, request: &Value) -> Result<Value>

POST /v1/certmesh/health - send health heartbeat.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more