api

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

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 is the HTTP API server for the Mnemonic system.

func NewServer

func NewServer(cfg ServerConfig, deps ServerDeps) *Server

NewServer creates a new HTTP server with the given configuration and dependencies.

func (*Server) Start

func (s *Server) Start() error

Start begins listening for HTTP requests. Non-blocking.

func (*Server) Stop

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

Stop gracefully shuts down the server.

type ServerConfig

type ServerConfig struct {
	Host              string
	Port              int
	RequestTimeoutSec int
	Token             string // bearer token for API auth (empty = no auth)
}

ServerConfig holds HTTP server configuration.

type ServerDeps

type ServerDeps struct {
	Store                 store.Store
	LLM                   llm.Provider
	Bus                   events.Bus
	Retriever             *retrieval.RetrievalAgent
	Consolidator          routes.ConsolidationRunner // can be nil if disabled
	AgentEvolutionDir     string                     // empty = agent dashboard disabled
	AgentWebPort          int                        // 0 = agent chat disabled
	IngestExcludePatterns []string
	IngestMaxContentBytes int
	Version               string
	ConfigPath            string                  // config file path for PID-based restart
	ServiceRestarter      routes.ServiceRestarter // can be nil if not installed as service
	PIDRestart            routes.PIDRestartFunc   // fallback restart when service manager unavailable
	Log                   *slog.Logger
}

ServerDeps holds dependencies injected into the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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