httpapi

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(opts ServerOptions) *http.Server

NewServer builds an HTTP server from options; kept for backward compatibility (prefer NewApp).

Types

type App

type App struct {
	Server       *http.Server
	Hub          *SSEHub
	Store        store.Store
	Capabilities *capabilities.Registry // optional; loaded from env (e.g. SLACK_WEBHOOK_URL)
	Home         string                 // data directory; for team/agent dirs and charter
}

App holds the HTTP server, SSE hub, store, capabilities registry, and home path.

func NewApp

func NewApp(opts ServerOptions) (*App, error)

NewApp creates the HTTP app (server, hub, store, capabilities) and registers all routes.

type SSEHub

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

func NewSSEHub

func NewSSEHub() *SSEHub

func (*SSEHub) Handler

func (h *SSEHub) Handler() http.HandlerFunc

func (*SSEHub) PublishJSON

func (h *SSEHub) PublishJSON(v any)

func (*SSEHub) Subscribe

func (h *SSEHub) Subscribe() chan []byte

func (*SSEHub) Unsubscribe

func (h *SSEHub) Unsubscribe(ch chan []byte)

type ServerOptions

type ServerOptions struct {
	Home           string
	Addr           string
	Dev            bool
	APIKey         string       // if set, require X-API-Key header or query api_key
	DBDriver       string       // "sqlite" (default) or "postgres"
	DBURL          string       // for postgres: connection string (or set DATABASE_URL env)
	MetricsHandler http.Handler // if set, used for /metrics (e.g. OTel Prometheus handler)
	UseOtelHTTP    bool         // if true, wrap handler with otelhttp for request metrics
}

ServerOptions configures the HTTP server (home dir, listen addr, API key, DB, metrics).

Jump to

Keyboard shortcuts

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