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

NameTypeDescription
hostStringHost to bind to
portu16Port to listen on
max_connectionsusizeMaximum connections
session_timeoutu64Session timeout in seconds
auth_enabledboolEnable authentication
auth_tokenOption<String>Authentication token (if auth_enabled)
tls_enabledboolEnable TLS
tls_cert_pathOption<String>TLS certificate path
tls_key_pathOption<String>TLS key path

Methods

new

rust
fn new() -> Self

Create a new config with defaults.

host

rust
fn host(mut self, host: impl Into<String>) -> Self

Set host.

Parameters:

NameType
hostimpl Into&lt;String&gt;

port

rust
fn port(mut self, port: u16) -> Self

Set port.

Parameters:

NameType
portu16

max_connections

rust
fn max_connections(mut self, max: usize) -> Self

Set max connections.

Parameters:

NameType
maxusize

session_timeout

rust
fn session_timeout(mut self, timeout: u64) -> Self

Set session timeout.

Parameters:

NameType
timeoutu64

auth

rust
fn auth(mut self, token: impl Into<String>) -> Self

Enable authentication with token.

Parameters:

NameType
tokenimpl Into&lt;String&gt;

tls

rust
fn tls(mut self, cert_path: impl Into<String>, key_path: impl Into<String>) -> Self

Enable TLS.

Parameters:

NameType
cert_pathimpl Into&lt;String&gt;
key_pathimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/gateway/mod.rs at line 298


Related Documentation