Documentation
¶
Index ¶
- type Option
- func WithCompactUpstreamChunkBytes(bytes int) Option
- func WithCompactUpstreamChunkConcurrency(concurrency int) Option
- func WithCompactUpstreamMaxAttempts(max int) Option
- func WithCopilotHeaderConfig(cfg proxy.CopilotHeaderConfig) Option
- func WithInboundAuthToken(token string) Option
- func WithPolicyRoutingAllowRemoteSingleTenant(allow bool) Option
- func WithProxyOptions(opts ...proxy.Option) Option
- func WithResponsesWebSocketConfig(cfg proxy.ResponsesWebSocketConfig) Option
- func WithStreamingUpstreamTimeout(timeout time.Duration) Option
- type Server
- func (s *Server) Addr() string
- func (s *Server) Done() <-chan error
- func (s *Server) DynamicProviderValidationPending() bool
- func (s *Server) InitializePolicyRouting(ctx context.Context) error
- func (s *Server) IsRunning() bool
- func (s *Server) MessagesAliasResolvesTo(ctx context.Context, alias, model string) bool
- func (s *Server) ModelUsesCopilot(model string) bool
- func (s *Server) SetStartupAuthenticationPending(pending bool)
- func (s *Server) Start() error
- func (s *Server) Stop(ctx context.Context) error
- func (s *Server) UsesCopilot() bool
- func (s *Server) ValidateDynamicProviderModels(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option customizes server creation.
func WithCompactUpstreamChunkBytes ¶ added in v0.10.3
WithCompactUpstreamChunkBytes overrides the initial body size targeted when chunking /v1/responses/compact retries after an upstream 413.
func WithCompactUpstreamChunkConcurrency ¶ added in v0.11.0
WithCompactUpstreamChunkConcurrency overrides the maximum number of sibling compact chunks sent concurrently after the first chunk succeeds.
func WithCompactUpstreamMaxAttempts ¶ added in v0.10.3
WithCompactUpstreamMaxAttempts caps the total logical compaction calls the /v1/responses/compact 413 fallback may perform per inbound request. Logical calls can produce extra real upstream POSTs through model fallback or the shared transport-retry policy.
func WithCopilotHeaderConfig ¶
func WithCopilotHeaderConfig(cfg proxy.CopilotHeaderConfig) Option
WithCopilotHeaderConfig overrides the synthetic Copilot-identifying headers sent on upstream requests.
func WithInboundAuthToken ¶ added in v0.14.0
WithInboundAuthToken requires this bearer or x-api-key token on every route except health and readiness probes. Empty keeps the public server behavior.
func WithPolicyRoutingAllowRemoteSingleTenant ¶ added in v0.14.0
WithPolicyRoutingAllowRemoteSingleTenant acknowledges that a policy-routing server bound beyond loopback is operated as a trusted single-tenant service.
func WithProxyOptions ¶
WithProxyOptions forwards proxy-level options to the underlying handler.
func WithResponsesWebSocketConfig ¶
func WithResponsesWebSocketConfig(cfg proxy.ResponsesWebSocketConfig) Option
WithResponsesWebSocketConfig overrides websocket-session handling for GET /v1/responses Codex clients.
func WithStreamingUpstreamTimeout ¶
WithStreamingUpstreamTimeout overrides the timeout used for streaming upstream inference requests and derives the server write timeout from it.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server encapsulates the HTTP server lifecycle.
func New ¶
func New(authenticator *auth.Authenticator, log *logger.Logger, host, port string, opts ...Option) (*Server, error)
New creates a Server with routes and timeouts configured.
func (*Server) Addr ¶
Addr returns the configured listen address, except that a server configured with port 0 reports the actual bound address after Start succeeds.
func (*Server) Done ¶ added in v0.14.0
Done reports the terminal Serve result. It yields nil after a normal shutdown and a non-nil error when the listener stops unexpectedly.
func (*Server) DynamicProviderValidationPending ¶ added in v0.14.1
DynamicProviderValidationPending reports whether deferred discovery remains.
func (*Server) InitializePolicyRouting ¶ added in v0.14.0
InitializePolicyRouting performs any configured policy-routing preflight.
func (*Server) MessagesAliasResolvesTo ¶ added in v0.14.14
MessagesAliasResolvesTo reports whether a Messages request naming alias is served like one naming model.
func (*Server) ModelUsesCopilot ¶ added in v0.14.0
ModelUsesCopilot reports whether launcher startup needs Copilot authentication to resolve or collision-check model.
func (*Server) SetStartupAuthenticationPending ¶ added in v0.13.0
SetStartupAuthenticationPending gates non-health routes while startup auth is in progress.
func (*Server) Start ¶
Start begins listening in a goroutine. It returns an error if the listener cannot be established and shuts down that generation. A concurrent Stop retains its deadline and background-finalization semantics. Create a new Server to retry after a failed start or shutdown.
func (*Server) UsesCopilot ¶ added in v0.14.1
UsesCopilot reports whether the active serve scope needs Copilot auth.