pub struct KoiClient { /* private fields */ }Implementations§
Source§impl KoiClient
impl KoiClient
pub fn new(endpoint: &str) -> Self
Sourcepub fn with_token(endpoint: &str, token: &str) -> Self
pub fn with_token(endpoint: &str, token: &str) -> Self
Create a client with a Daemon Access Token for authenticated requests.
Create a client from the breadcrumb file (endpoint + token).
Returns None if no breadcrumb exists.
pub fn register(&self, payload: &RegisterPayload) -> Result<RegistrationResult>
pub fn unregister(&self, id: &str) -> Result<()>
pub fn heartbeat(&self, id: &str) -> Result<RenewalResult>
pub fn resolve(&self, instance: &str) -> Result<ServiceRecord>
Sourcepub fn browse_stream(&self, service_type: &str) -> Result<SseStream>
pub fn browse_stream(&self, service_type: &str) -> Result<SseStream>
Start a browse SSE stream. Returns an iterator of JSON events.
Sourcepub fn events_stream(&self, service_type: &str) -> Result<SseStream>
pub fn events_stream(&self, service_type: &str) -> Result<SseStream>
Start an events SSE stream. Returns an iterator of JSON events.
Sourcepub fn unified_status(&self) -> Result<Value>
pub fn unified_status(&self) -> Result<Value>
Fetch unified status from /v1/status.
pub fn dns_status(&self) -> Result<Value>
pub fn dns_lookup(&self, name: &str, record_type: RecordType) -> Result<Value>
pub fn dns_list(&self) -> Result<Value>
pub fn dns_add(&self, name: &str, ip: &str, ttl: Option<u32>) -> Result<Value>
pub fn dns_remove(&self, name: &str) -> Result<Value>
pub fn dns_start(&self) -> Result<Value>
pub fn dns_stop(&self) -> Result<Value>
pub fn health_status(&self) -> Result<Value>
pub fn health_add_check( &self, name: &str, kind: ServiceCheckKind, target: &str, interval_secs: u64, timeout_secs: u64, ) -> Result<Value>
pub fn health_remove_check(&self, name: &str) -> Result<Value>
pub fn proxy_status(&self) -> Result<Value>
pub fn proxy_list(&self) -> Result<Value>
pub fn proxy_add( &self, name: &str, listen_port: u16, backend: &str, allow_remote: bool, ) -> Result<Value>
pub fn proxy_remove(&self, name: &str) -> Result<Value>
pub fn udp_status(&self) -> Result<Value>
pub fn udp_bind(&self, port: u16, addr: &str, lease_secs: u64) -> Result<Value>
pub fn udp_unbind(&self, id: &str) -> Result<Value>
pub fn udp_send(&self, id: &str, dest: &str, payload_b64: &str) -> Result<Value>
pub fn udp_heartbeat(&self, id: &str) -> Result<Value>
Sourcepub fn post_json(&self, path: &str, body: &Value) -> Result<Value>
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.
Sourcepub fn get_json(&self, path: &str) -> Result<Value>
pub fn get_json(&self, path: &str) -> Result<Value>
GET JSON from an arbitrary path and return the response as a JSON value.
Sourcepub fn put_json(&self, path: &str, body: &Value) -> Result<Value>
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.
pub fn admin_status(&self) -> Result<DaemonStatus>
pub fn admin_registrations(&self) -> Result<Vec<AdminRegistration>>
pub fn admin_inspect(&self, id: &str) -> Result<AdminRegistration>
pub fn admin_force_unregister(&self, id: &str) -> Result<()>
pub fn admin_drain(&self, id: &str) -> Result<()>
pub fn admin_revive(&self, id: &str) -> Result<()>
Auto Trait Implementations§
impl !RefUnwindSafe for KoiClient
impl !UnwindSafe for KoiClient
impl Freeze for KoiClient
impl Send for KoiClient
impl Sync for KoiClient
impl Unpin for KoiClient
impl UnsafeUnpin for KoiClient
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
Mutably borrows from an owned value. Read more