gateway

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// Providers lists the configured LLM providers.
	Providers map[string]provider.ProviderConfig `json:"providers,omitempty"`
	// ConfigStore configures persistent admin/auth state storage.
	ConfigStoreRaw caddy.ModuleMap `json:"config_store,omitempty" caddy:"namespace=agent_gateway.config_store_backends"`
	// ProviderTypes configures startup-only provider type availability.
	ProviderTypes []provider.ProviderTypeSetting `json:"provider_types,omitempty"`
	// CredentialRefreshCommand is the external executable used for
	// request-time credential refresh. It defaults to agw-auth.
	CredentialRefreshCommand string `json:"credential_refresh_command,omitempty"`
	// CredentialRefreshArgs are static arguments passed to the external
	// credential refresh executable. They default to ["refresh"] when the
	// command is omitted.
	CredentialRefreshArgs []string `json:"credential_refresh_args,omitempty"`
	// LLMRoutes lists statically configured gateway LLM route configs from the Caddyfile app block.
	LLMRoutes []routecore.AgentRouteConfig `json:"llm_routes,omitempty"`
	// Metrics configures observability retention, agent-chain governance, and
	// optional OTLP span export of usage events.
	Metrics usage.Config `json:"metrics,omitzero"`
	// contains filtered or unexported fields
}

App is the Caddy app module for the Agent Gateway. It manages providers, MCP clients, memory stores, and configuration.

func GetApp

func GetApp(ctx caddy.Context) (*App, error)

GetApp retrieves the agent gateway app from the Caddy context.

func (*App) AgentGateway

func (a *App) AgentGateway() *runtimegateway.AgentGateway

AgentGateway returns the gateway instance owned by this app. It returns nil if called before Provision completes.

func (App) CaddyModule

func (App) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*App) ConfigStore

func (a *App) ConfigStore() configstore.ConfigStoreBackend

func (*App) CredentialManager

func (a *App) CredentialManager() *credential.Manager

CredentialManager returns the shared upstream credential manager.

func (*App) Provider

func (a *App) Provider(name string) (provider.Provider, bool)

Provider returns a configured provider by name.

func (*App) Provision

func (a *App) Provision(ctx caddy.Context) error

Provision sets up the app.

func (*App) Start

func (a *App) Start() error

Start starts the app.

func (*App) Stop

func (a *App) Stop() error

Stop stops the app.

func (*App) Validate

func (a *App) Validate() error

Validate validates the app configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL