ScoutQuest Rust SDK
Rust SDK for ScoutQuest Service Discovery - Universal service discovery for microservices architectures.
Features
- 🔍 Service Discovery: Find and connect to services dynamically
- 📝 Service Registration: Register your services with health checks
- ⚖️ Load Balancing: Multiple strategies (Random, Round-Robin, Healthy-Only)
- 🌐 HTTP Client: Built-in HTTP client with automatic service discovery
- 🏷️ Metadata & Tags: Rich service metadata and tag-based filtering
- 💓 Health Monitoring: Automatic heartbeat and health check support
- 🔄 Retry Logic: Configurable retry mechanism for resilience
- 📊 Tracing Support: Built-in logging and tracing integration
Installation
Add this to your Cargo.toml:
[]
= "1.0.0"
Quick Start
use *;
async
Advanced Usage
Load Balancing Strategies
use *;
let client = new?;
// Service discovery returns a ready-to-use service instance
let instance = client.discover_service.await?;
// Use the instance to make HTTP calls
let response = client.get.await?;
Service Discovery with Filters
let discovery_options = new
.with_healthy_only
.with_tags
.with_limit;
let instances = client.discover_service.await?;
HTTP Client with Custom Configuration
// GET request
let users: Value = client.get.await?;
// POST request
let new_user = json!;
let response: Value = client.post.await?;
// Custom request with specific load balancing
let response: Value = client.call_service.await?;
Health Checks
use *;
let health_check = HealthCheck ;
let options = new
.with_health_check;
client.register_service.await?;
Configuration
Create a client with custom configuration:
use Duration;
let client = with_config?;
Examples
See the examples/ directory for complete examples:
- Basic Usage:
examples/basic_usage.rs - HTTP Client:
examples/http_client.rs - Load Balancing:
examples/load_balancing.rs
Run examples with:
Error Handling
The SDK provides comprehensive error types:
use ScoutQuestError;
match client.discover_service.await
Testing
Run the test suite:
# Unit tests
# Integration tests
# All tests with output
Benchmarks
Run performance benchmarks:
This will benchmark load balancing strategies and other performance-critical operations.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Documentation
Support
- 📧 Email: team@scoutquest.dev
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions