Configuration Options
This page documents all available configuration options for the library. Each option can be set programmatically or through configuration files.
Basic Options
The following table lists the basic configuration options:
| Option | Type | Default | Description |
|---|---|---|---|
| timeout | integer | 30 | Request timeout in seconds |
| retries | integer | 3 | Number of retry attempts |
| debug | boolean | false | Enable debug logging |
| cache_enabled | boolean | true | Enable response caching |
Advanced Options
| Option | Type | Default | Description |
|---|---|---|---|
| max_connections | integer | 100 | Maximum concurrent connections |
| buffer_size | integer | 8192 | I/O buffer size in bytes |
Code Examples
Here's how to configure the library in different languages:
Rust
use mylib::Config;
fn main() {
let config = Config::builder()
.timeout(60)
.retries(5)
.debug(true)
.build();
let client = Client::new(config);
}
Python
from mylib import Config, Client
config = Config(
timeout=60,
retries=5,
debug=True
)
client = Client(config)
Environment Variables
Configuration can also be set via environment variables:
MYLIB_TIMEOUT- Sets the timeout valueMYLIB_RETRIES- Sets the retry countMYLIB_DEBUG- Enables debug mode when set to "true"
Configuration File
Create a config.toml file in your project root:
[settings]
timeout = 60
retries = 5
debug = true
[advanced]
max_connections = 200
buffer_size = 16384