summaryrefslogtreecommitdiff
path: root/examples/test.rs
blob: e7c34c86f004f4e44b7367f9e6f776479ad8a4fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use df_consul::*;

#[tokio::main]
async fn main() {
	let config = ConsulConfig {
		addr: "http://localhost:8500".into(),
		ca_cert: None,
		tls_skip_verify: false,
		client_cert: None,
		client_key: None,
	};

	let consul = Consul::new(config, "").unwrap();

	println!("== LIST NODES ==");
	let list_nodes = consul.list_nodes().await.unwrap();
	println!("{:?}", list_nodes);

	println!("== CATALOG 1 ==");
	println!("{:?}", consul.watch_node("caribou", None).await.unwrap());

	println!("== CATALOG 2 ==");
	println!("{:?}", consul.watch_node("cariacou", None).await.unwrap());
}