server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveRunner

type ArchiveRunner interface {
	Run() error
}

ArchiveRunner compresses old flat files on a schedule.

type DB

type DB interface {
	Healthy(ctx context.Context) bool
	Counts(ctx context.Context) (total, embedded int64, err error)
	GetUnembedded(ctx context.Context) ([]domain.Entry, error)
}

DB is the subset of database operations the server requires.

type DiskMonitor

type DiskMonitor interface {
	Start(ctx context.Context)
	Warning() bool
	Free() int64
	Total() int64
}

DiskMonitor exposes disk health state.

type EmbedHealthChecker

type EmbedHealthChecker interface {
	Healthy(ctx context.Context) bool
}

EmbedHealthChecker reports embedding service health.

type EmbedPool

type EmbedPool interface {
	Enqueue(id uuid.UUID, content string)
	StartWorkers(ctx context.Context, n int)
	Wait()
}

EmbedPool manages async embedding jobs.

type HealthResponse

type HealthResponse struct {
	Status         string `json:"status"`
	Ollama         string `json:"ollama"`
	Postgres       string `json:"postgres"`
	EntryCount     int64  `json:"entry_count"`
	EmbeddedCount  int64  `json:"embedded_count"`
	DiskFreeBytes  int64  `json:"disk_free_bytes"`
	DiskTotalBytes int64  `json:"disk_total_bytes"`
	DiskWarning    bool   `json:"disk_warning"`
}

HealthResponse is the /health endpoint response body.

type Server

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

Server is the Eidetic HTTP server.

func New

func New(
	cfg *config.Config,
	handler *mcp.Handler,
	db DB,
	embedPool EmbedPool,
	embedHealth EmbedHealthChecker,
	diskMon DiskMonitor,
	archiver ArchiveRunner,
) *Server

New assembles the server from its dependencies. The MCP handler and all tool wiring must be done by the caller (main.go); the server only dispatches HTTP.

func (*Server) Run

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

Run starts the server and blocks until ctx is cancelled or a signal received.

Jump to

Keyboard shortcuts

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