pub struct GatewayConfig {
pub enabled: bool,
pub routes: Vec<GatewayRoute>,
pub default_provider: Option<ProviderId>,
pub auth_scheme: String,
pub inference_path_prefix: String,
}Expand description
Runtime gateway configuration: the post-resolution shape every non-loader caller sees.
Not Deserialize: the only legal construction paths are
GatewayConfigSpec::resolve for the production loader and direct
struct-literal construction in tests.
Fields§
§enabled: bool§routes: Vec<GatewayRoute>§default_provider: Option<ProviderId>§auth_scheme: String§inference_path_prefix: StringImplementations§
Source§impl GatewayConfig
impl GatewayConfig
pub fn find_route(&self, model: &str) -> Option<&GatewayRoute>
Sourcepub fn resolve_route<'a>(
&'a self,
registry: &ProviderRegistry,
model: &str,
) -> Option<Cow<'a, GatewayRoute>>
pub fn resolve_route<'a>( &'a self, registry: &ProviderRegistry, model: &str, ) -> Option<Cow<'a, GatewayRoute>>
Resolve the route for model: an explicit match if one exists, else a
synthetic catch-all route to Self::default_provider when configured
and present in registry. None only when neither applies — the caller
then denies the request.
pub fn is_model_exposed(&self, registry: &ProviderRegistry, model: &str) -> bool
Sourcepub fn validate(&self, registry: &ProviderRegistry) -> GatewayResult<()>
pub fn validate(&self, registry: &ProviderRegistry) -> GatewayResult<()>
Validate the gateway’s references into registry: route-id uniqueness,
and that default_provider (if set) and every route provider resolve to
a registry entry. The registry validates its own models separately.
Sourcepub fn to_spec(&self) -> GatewayConfigSpec
pub fn to_spec(&self) -> GatewayConfigSpec
Round-trips a resolved config back to its on-disk spec for persisting a profile to YAML.
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more