server

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 34 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

This section is empty.

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) *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

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).

Jump to

Keyboard shortcuts

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