http

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package http implements the REST API server for Cortex.

It exposes observation, session, search, graph, and scoring endpoints using the standard library net/http package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Observations      *sqlitestore.Store
	Sessions          *session.Store
	Search            *search.Store
	Prompts           *prompt.Store
	Graph             *graphstore.Store
	Scoring           *scoringstore.Store
	TemporalSnapshots *sqlitestore.TemporalSnapshotRepository
}

Deps bundles store dependencies for HTTP handlers.

type Options

type Options struct {
	AuthToken string
}

Options configures optional HTTP hardening behavior.

type Server

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

Server wraps an http.Server with Cortex handlers.

func NewServer

func NewServer(addr string, deps *Deps, opts Options) *Server

NewServer creates a new HTTP server on the given address.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the server's listen address.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the HTTP server.

func (*Server) Shutdown

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

Shutdown gracefully stops the server.

Jump to

Keyboard shortcuts

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