scoutquest_rust/
lib.rs

1//! # ScoutQuest Rust SDK
2//!
3//! This SDK allows easy interaction with ScoutQuest Service Discovery.
4//! It provides registration and discovery functionalities
5//! for your Rust microservices.
6//!
7//! ## Usage Example
8//!
9//! ```rust,no_run
10//! use scoutquest_rust::*;
11//!
12//! #[tokio::main]
13//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
14//!     // Create the client
15//!     let client = ServiceDiscoveryClient::new("http://localhost:8080")?;
16//!
17//!     // Register the service
18//!     let options = ServiceRegistrationOptions::new()
19//!         .with_tags(vec!["api".to_string(), "microservice".to_string()]);
20//!
21//!     client.register_service("user-service", "localhost", 3000, Some(options)).await?;
22//!
23//!     // Discover other services
24//!     let instance = client.discover_service("user-service", None).await?;
25//!
26//!     // Call another service
27//!     let response: serde_json::Value = client.get("user-service", "/api/users").await?;
28//!
29//!     Ok(())
30//! }
31//! ```
32
33pub mod client;
34pub mod error;
35pub mod models;
36
37pub use client::ServiceDiscoveryClient;
38pub use error::ScoutQuestError;
39pub use models::*;
40
41pub const VERSION: &str = env!("CARGO_PKG_VERSION");