Expand description
Create and manage distributed applications in Rust.
Built with the motto - Plug the crate in, it’ll be taken care of.
§Usage
let result = KubernetesDiscoverService::init("demo".to_string(), "default".to_string())
.await;
if let Ok(k8s) = result {
let cluster = Arc::new(Cluster::default());
let client = DiscoveryClient::new(k8s);
let config = ClusterConfig::default();
tokio::spawn(start_cluster(cluster, client, config));
}
The Cluster
struct provides a set of functions for example async fn primaries(&self) -> Option<HashSet<RestClusterNode>>
or async fn is_active(&self) -> bool
to communicate with the cluster.
Checkout Cluster for more details
Structs§
- Cluster
- Describes a cluster, including operating mode, primaries & secondaries
- Cluster
Config - Set cluster configurations
- Cluster
Info - Describe cluster
- Rest
Cluster Node - An implementation of almost_raft::Node
Enums§
- Instance
Mode - Status of a node/instance
Functions§
- get_
cluster_ info - Returns selective information on current cluster
- start_
cluster - Start the cluster. Note that, this function has infinite loop, so should always spawn a new thread.