consul-rs

Crates.ioconsul-rs
lib.rsconsul-rs
version0.1.14
sourcesrc
created_at2021-05-27 09:51:22.812863
updated_at2021-07-13 09:55:00.284284
descriptionconsul api
homepagehttps://github.com/ptechen
repositoryhttps://github.com/ptechen/consul-rs.git
max_upload_size
id402602
size41,872
Petechen (ptechen)

documentation

https://github.com/ptechen/consul-rs/blob/main/README.md

README

consul api

consul config, consul.yaml

config:
  address: http://127.0.0.1:8500
  datacenter: dc1
  wait_time: 5s

watch_services:
  - service_name: hyat_rust
    passing_only: true
    tag: ''

load config

ConsulConfig::load_config("consul.yaml").await?;

consul watch

let consul_config = CONSUL_CONFIG.clone();
let consul_config = consul_config.read().await;
consul_config.watch_services().await?;
Commit count: 36

cargo fmt