handler

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess       = 0
	CodeBadRequest    = 40000
	CodeUnauthorized  = 40100
	CodeForbidden     = 40300
	CodeNotFound      = 40400
	CodeConflict      = 40900
	CodeInternalError = 50000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminHandler

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

func NewAdminHandler

func NewAdminHandler(provider *config.Provider, restartCh chan<- struct{}, stopCh chan<- struct{}) *AdminHandler

func (*AdminHandler) RegisterRoutes

func (a *AdminHandler) RegisterRoutes(r *gin.RouterGroup)

type Handler

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

func NewHandler

func NewHandler(provider *config.Provider, usageStore *store.UsageStore, r router.Router, trace *hook.TraceRecorder) *Handler

func (*Handler) RegisterHook added in v0.1.9

func (h *Handler) RegisterHook(hk hook.Hook)

RegisterHook adds a lifecycle hook to the pipeline.

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(r *gin.Engine)

RegisterRoutes registers all API endpoints.

func (*Handler) SyncKeys added in v0.1.12

func (h *Handler) SyncKeys()

SyncKeys rebuilds the KeyManager from the current config. Call on startup and after config reload.

type ModelInfo added in v0.1.7

type ModelInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ModelInfo represents a single model returned by the fetch-models endpoint.

type TraceHandler added in v0.1.9

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

TraceHandler provides REST API endpoints for querying JSONL trace files.

func NewTraceHandler added in v0.1.9

func NewTraceHandler(dataDir string) *TraceHandler

NewTraceHandler creates a new TraceHandler with the given data directory.

func (*TraceHandler) RegisterRoutes added in v0.1.9

func (t *TraceHandler) RegisterRoutes(r *gin.RouterGroup)

RegisterRoutes registers trace API routes on the given router group.

Jump to

Keyboard shortcuts

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