server

package
v1.6.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the build's release version, reported by /healthz.

Functions

This section is empty.

Types

type GRPCServer

type GRPCServer struct {
	// contains filtered or unexported fields
}

GRPCServer hosts the proxy data-plane and admin services.

func NewGRPCServer

func NewGRPCServer(proxy pb.GatewayServiceServer, admin pb.AdminServiceServer,
	nodeReg pb.NodeRegistryServiceServer, verifier *apikeys.Verifier, addr string, maxRecvMsgSize int) *GRPCServer

NewGRPCServer wires interceptors (logging first, auth second) and registers the services.

func (*GRPCServer) Start

func (s *GRPCServer) Start() error

func (*GRPCServer) Stop

func (s *GRPCServer) Stop()

type HTTPServer

type HTTPServer struct {
	// contains filtered or unexported fields
}

HTTPServer serves the health endpoints and, when configured, the OpenAI-compatible API.

func NewHTTPServer

func NewHTTPServer(pinger Pinger, addr string, api *OpenAIAPI, requestTimeout time.Duration, more ...Registrar) *HTTPServer

NewHTTPServer creates the HTTP server. api may be nil (health only); requestTimeout bounds one API call, which waits on an upstream model.

func (*HTTPServer) Shutdown

func (s *HTTPServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the HTTP server

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the HTTP server

func (*HTTPServer) WithDegradedReadiness added in v0.13.1

func (s *HTTPServer) WithDegradedReadiness(window time.Duration) *HTTPServer

WithDegradedReadiness keeps /readyz at 200 for up to window after the last good ping, while recently verified keys still work (AUTH_STALE_IF_ERROR): a 503 would pull every replica at once. Past the window nothing is served.

type OpenAIAPI

type OpenAIAPI struct {
	// contains filtered or unexported fields
}

OpenAIAPI serves the data plane over HTTP in the OpenAI wire format. It calls the same handlers as gRPC after the same key and scope check, so routing, throttling and usage reporting behave identically on both transports.

func NewOpenAIAPI

func NewOpenAIAPI(proxy pb.GatewayServiceServer, verifier *apikeys.Verifier) *OpenAIAPI

func (*OpenAIAPI) Register

func (a *OpenAIAPI) Register(mux *http.ServeMux)

Register mounts the routes under /v1.

type Pinger

type Pinger interface {
	Ping(ctx context.Context) error
}

Pinger is the readiness dependency (the pgx pool in production).

type Registrar added in v1.4.0

type Registrar interface {
	Register(mux *http.ServeMux)
}

Registrar mounts more handlers on the HTTP server, such as the MCP gateway.

Jump to

Keyboard shortcuts

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