Documentation
¶
Index ¶
- func NewIPAccessControlRuntime(cfg Config) (*middleware.IPAccessControlConfig, error)
- func Run(opts ...fx.Option)
- func SetupRoutes(server *Server, handlers Handlers, client *ent.Client, services Services, ...)
- type API
- type APIAuth
- type CORS
- type Config
- type Dashboard
- type Handlers
- type IPAccessControl
- type Server
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIPAccessControlRuntime ¶
func NewIPAccessControlRuntime(cfg Config) (*middleware.IPAccessControlConfig, error)
NewIPAccessControlRuntime creates the single mutable runtime state used by the IP access-control middleware. SIGHUP reload handling updates this object directly instead of rebuilding routes or introducing a global configuration event bus.
func SetupRoutes ¶
func SetupRoutes(server *Server, handlers Handlers, client *ent.Client, services Services, ipAccessControl *middleware.IPAccessControlConfig)
Types ¶
type CORS ¶
type CORS struct {
Enabled bool `conf:"enabled" yaml:"enabled" json:"enabled"`
AllowedOrigins []string `conf:"allowed_origins" yaml:"allowed_origins" json:"allowed_origins"`
AllowedMethods []string `conf:"allowed_methods" yaml:"allowed_methods" json:"allowed_methods"`
AllowedHeaders []string `conf:"allowed_headers" yaml:"allowed_headers" json:"allowed_headers"`
ExposedHeaders []string `conf:"exposed_headers" yaml:"exposed_headers" json:"exposed_headers"`
AllowCredentials bool `conf:"allow_credentials" yaml:"allow_credentials" json:"allow_credentials"`
MaxAge time.Duration `conf:"max_age" yaml:"max_age" json:"max_age"`
}
type Config ¶
type Config struct {
Host string `conf:"host" yaml:"host" json:"host"`
Port int `conf:"port" yaml:"port" json:"port"`
PublicURL string `conf:"public_url" yaml:"public_url" json:"public_url"`
Name string `conf:"name" yaml:"name" json:"name"`
BasePath string `conf:"base_path" yaml:"base_path" json:"base_path"`
PidFile string `conf:"pid_file" yaml:"pid_file" json:"pid_file"`
ReadTimeout time.Duration `conf:"read_timeout" yaml:"read_timeout" json:"read_timeout"`
// RequestTimeout is the maximum duration for processing a request.
RequestTimeout time.Duration `conf:"request_timeout" yaml:"request_timeout" json:"request_timeout"`
// LLMRequestTimeout is the maximum duration for processing a request to LLM.
LLMRequestTimeout time.Duration `conf:"llm_request_timeout" yaml:"llm_request_timeout" json:"llm_request_timeout"`
Trace tracing.Config `conf:"trace" yaml:"trace" json:"trace"`
Dashboard Dashboard `conf:"dashboard" yaml:"dashboard" json:"dashboard"`
Debug bool `conf:"debug" yaml:"debug" json:"debug"`
DisableSSLVerify bool `conf:"disable_ssl_verify" yaml:"disable_ssl_verify" json:"disable_ssl_verify"`
CORS CORS `conf:"cors" yaml:"cors" json:"cors"`
API API `conf:"api" yaml:"api" json:"api"`
IPAccessControl IPAccessControl `conf:"ip_access_control" yaml:"ip_access_control" json:"ip_access_control"`
}
type Dashboard ¶
type Dashboard struct {
// AllTimeTokenStatsSoftTTL is the duration after which cached all-time token stats
// are considered stale and will be refreshed asynchronously (stale-while-revalidate).
// Default: 1 hour
AllTimeTokenStatsSoftTTL time.Duration `conf:"all_time_token_stats_soft_ttl" yaml:"all_time_token_stats_soft_ttl" json:"all_time_token_stats_soft_ttl"`
// AllTimeTokenStatsHardTTL is the maximum duration for which cached all-time token stats
// are considered valid. After this, synchronous refresh is required.
// Default: 24 hours
AllTimeTokenStatsHardTTL time.Duration `conf:"all_time_token_stats_hard_ttl" yaml:"all_time_token_stats_hard_ttl" json:"all_time_token_stats_hard_ttl"`
}
Dashboard holds configuration for the dashboard cache settings.
type Handlers ¶
type Handlers struct {
fx.In
Graphql *gql.GraphqlHandler
OpenAPIGraphql *openapi.GraphqlHandler
OpenAI *api.OpenAIHandlers
Adapter *api.AdapterHandlers
Doubao *api.DoubaoHandlers
Anthropic *api.AnthropicHandlers
Gemini *api.GeminiHandlers
AiSDK *api.AiSDKHandlers
Playground *api.PlaygroundHandlers
System *api.SystemHandlers
Auth *api.AuthHandlers
Jina *api.JinaHandlers
Codex *api.CodexHandlers
ClaudeCode *api.ClaudeCodeHandlers
Antigravity *api.AntigravityHandlers
Copilot *api.CopilotHandlers
RequestContent *api.RequestContentHandlers
OIDC *api.OIDCHandlers
RequestPreview *api.RequestPreviewHandlers
Gateway *api.GatewayHandlers
}
type IPAccessControl ¶
type Services ¶
type Services struct {
fx.In
TraceService *biz.TraceService
ThreadService *biz.ThreadService
AuthService *biz.AuthService
SystemService *biz.SystemService
AdapterService *biz.AdapterService
}
Directories
¶
| Path | Synopsis |
|---|---|
|
racetest
Package racetest holds opt-in, build-tagged integration tests that need a real concurrent database (PostgreSQL, MySQL, or TiDB).
|
Package racetest holds opt-in, build-tagged integration tests that need a real concurrent database (PostgreSQL, MySQL, or TiDB). |
|
qb
Package qb provides database utilities and query builders for llm-proxy.
|
Package qb provides database utilities and query builders for llm-proxy. |
Click to show internal directories.
Click to hide internal directories.