server

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server exposes kram-gateway's OpenAI-compatible HTTP API and wires together routing, circuit breaking and telemetry for each request. The top-level handler always recovers from panics: a bug or an upstream surprise in one request must never take the process down.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server holds everything a request handler needs.

func New

func New(cfg *config.Config, providers map[string]provider.Provider, rt *router.Router, breakers *breaker.Registry, tel *telemetry.Registry, logger *slog.Logger) *Server

New builds a Server from already-constructed dependencies.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the fully wired HTTP handler, including panic recovery.

Jump to

Keyboard shortcuts

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