apollo-rust-client-0.1.0 has been yanked.
apollo-rust-client
A Rust client for Apollo Configuration centre.
Features
- Support for multiple namespaces
- Configuration updates via polling
- Type-safe configuration management
- Async/await support
- Error handling with detailed diagnostics
Installation
Add the following to your Cargo.toml
:
[]
= "0.1.0"
Usage
Basic Example
use Client;
use ClientConfig;
async
Configuration
The client supports the following configuration options:
app_id
: Your application ID in Apollocluster
: The cluster name (default: "default
")secret
: The optional secret for the givenapp_id
config_server
: The address of the configuration servercache_dir
: Directory to store local cache (default: "/opt/data/${app_id}/config-cache
")label
: The label of the current instance. Used to identify the current instance for a grayscale release.ip
: The IP address of your application. Used to identify the current instance for a grayscale release.
Error Handling
The client provides detailed error information through the ApolloError
type, which includes:
- Network errors
- Configuration parsing errors
- Authentication errors
- Invalid response errors
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.