Versions in this module Expand all Collapse all v1 v1.3.11 Oct 12, 2026 v1.3.9 Oct 7, 2026 Changes in this version + const DefaultProc + type AuditRecord struct + Duration time.Duration + Error string + Kind Kind + Method string + Model string + Outcome Outcome + Path string + Reason string + RemoteID string + Status int + Time time.Time + Tools []string + Upstream string + Usage Usage + User string + UserID int + type AuditSink interface + Record func(AuditRecord) + type Config struct + Audit AuditSink + MaxBodyBytes int64 + Prefix string + StripHeaders []string + type Definition struct + Allowed []string + Kind Kind + Upstream Upstream + type HookContext struct + Abort bool + AbortCode int + AbortMessage string + Context context.Context + Duration time.Duration + Error error + Kind Kind + Model string + Request *http.Request + StatusCode int + Tools []string + Upstream string + Usage Usage + UserContext *security.UserContext + type HookFunc func(*HookContext) error + type HookRegistry struct + func NewHookRegistry() *HookRegistry + func (r *HookRegistry) Execute(t HookType, ctx *HookContext) error + func (r *HookRegistry) Register(t HookType, h HookFunc) + type HookType string + const AfterProxy + const BeforeProxy + type Kind string + const KindMCP + const KindOpenAI + type LogAuditSink struct + func (LogAuditSink) Record(r AuditRecord) + type MCPUpstream struct + AllowedTools []string + type NopAuditSink struct + func (NopAuditSink) Record(AuditRecord) + type OpenAIUpstream struct + AllowedModels []string + type Outcome string + const OutcomeDenied + const OutcomeOK + const OutcomeRateLimited + const OutcomeUpstreamError + type ProcStore struct + func NewProcStore(db *sql.DB, proc string) (*ProcStore, error) + func NewProcStoreFromDatabase(db common.Database, proc string) (*ProcStore, error) + func (s *ProcStore) List(ctx context.Context) ([]Definition, error) + type Proxy struct + func New(cfg Config) *Proxy + func (p *Proxy) AutoReload(ctx context.Context, store UpstreamStore, interval time.Duration) error + func (p *Proxy) Handler(auth func(http.Handler) http.Handler) http.Handler + func (p *Proxy) Hooks() *HookRegistry + func (p *Proxy) Names() []string + func (p *Proxy) Register(d Definition) error + func (p *Proxy) RegisterMCP(u MCPUpstream) error + func (p *Proxy) RegisterOpenAI(u OpenAIUpstream) error + func (p *Proxy) Reload(ctx context.Context, store UpstreamStore) error + func (p *Proxy) Unregister(name string) bool + type RateLimit struct + Burst int + PerSecond float64 + type Upstream struct + APIKey string + AllowedRoles []string + AuthFormat string + AuthHeader string + BaseURL string + Headers map[string]string + Name string + RateLimit *RateLimit + Timeout time.Duration + func (u Upstream) GoString() string + func (u Upstream) MarshalJSON() ([]byte, error) + func (u Upstream) String() string + type UpstreamStore interface + List func(ctx context.Context) ([]Definition, error) + type Usage struct + CompletionTokens int64 + PromptTokens int64 + TotalTokens int64