serverapi

package
v0.28.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHealthRoutes

func AddHealthRoutes(mux *http.ServeMux)

AddHealthRoutes registers GET /health for liveness checks.

func AddVersionRoutes

func AddVersionRoutes(mux *http.ServeMux, version, nodeInstanceID, tenancy string)

AddVersionRoutes registers GET /version.

func IsLoopbackAddress

func IsLoopbackAddress(addr string) bool

func LoadConfig

func LoadConfig[T any](cfg *T) error

func New

func New(ctx context.Context, mux *http.ServeMux, nodeInstanceID, tenancy string, config *Config, deps ...Dependencies) (func() error, error)

func ProtectMutatingAPI

func ProtectMutatingAPI(token string, next http.Handler) http.Handler

func ValidateLocalServeSecurity

func ValidateLocalServeSecurity(addr, token string) error

Types

type Config

type Config struct {
	DatabaseURL         string `json:"database_url"`
	Port                string `json:"port"`
	Addr                string `json:"addr"`
	NATSURL             string `json:"nats_url"`
	NATSUser            string `json:"nats_user"`
	NATSPassword        string `json:"nats_password"`
	TokenizerServiceURL string `json:"tokenizer_service_url"`
	Token               string `json:"token"`
	UIBaseURL           string `json:"ui_base_url"`
	ValkeyAddr          string `json:"valkey_addr"`
	ValkeyPassword      string `json:"valkey_password"`
	TerminalEnabled     string `json:"terminal_enabled"`
	TerminalAllowedRoot string `json:"terminal_allowed_root"`
	TerminalShell       string `json:"terminal_shell"`
	TerminalIdleTimeout string `json:"terminal_idle_timeout"`
}

type Dependencies

type Dependencies struct {
	DB                   libdb.DBManager
	PubSub               libbus.Messenger
	State                *runtimestate.State
	ToolsProviderService toolsproviderservice.Service
	Auth                 middleware.AuthZReader
	Agent                agentservice.Agent
	ChatManager          *chatservice.Manager
	Chains               taskchainservice.Service
	HITLService          hitlservice.Service
	TerminalService      terminalservice.Service
	TerminalEnabled      bool
	WorkspaceID          string
	ProjectRoot          string
	ContenoxDir          string
	DefaultChainRef      string
	DefaultModel         string
	DefaultProvider      string
	AltDefaultModel      string
	AltDefaultProvider   string
	DefaultThink         string
}

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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