Gateway Config • Rust AI Agent SDK
GatewayConfig: Configuration for a gateway.
GatewayConfig
Defined in the gateway module.
Rust AI Agent SDK
Configuration for a gateway.
Fields
| Name | Type | Description |
|---|---|---|
host | String | Host to bind to |
port | u16 | Port to listen on |
max_connections | usize | Maximum connections |
session_timeout | u64 | Session timeout in seconds |
auth_enabled | bool | Enable authentication |
auth_token | Option<String> | Authentication token (if auth_enabled) |
tls_enabled | bool | Enable TLS |
tls_cert_path | Option<String> | TLS certificate path |
tls_key_path | Option<String> | TLS key path |
Methods
new
fn new() -> SelfCreate a new config with defaults.
host
fn host(mut self, host: impl Into<String>) -> SelfSet host.
Parameters:
| Name | Type |
|---|---|
host | impl Into<String> |
port
fn port(mut self, port: u16) -> SelfSet port.
Parameters:
| Name | Type |
|---|---|
port | u16 |
max_connections
fn max_connections(mut self, max: usize) -> SelfSet max connections.
Parameters:
| Name | Type |
|---|---|
max | usize |
session_timeout
fn session_timeout(mut self, timeout: u64) -> SelfSet session timeout.
Parameters:
| Name | Type |
|---|---|
timeout | u64 |
auth
fn auth(mut self, token: impl Into<String>) -> SelfEnable authentication with token.
Parameters:
| Name | Type |
|---|---|
token | impl Into<String> |
tls
fn tls(mut self, cert_path: impl Into<String>, key_path: impl Into<String>) -> SelfEnable TLS.
Parameters:
| Name | Type |
|---|---|
cert_path | impl Into<String> |
key_path | impl Into<String> |
Source
View on GitHubpraisonai/src/gateway/mod.rs at line 298