server

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(d Deps) http.Handler

NewHandler returns the full HTTP handler (mux + middleware) for the server.

Types

type Deps

type Deps struct {
	DB            *gorm.DB
	MCPServer     *mcp.Server
	KeyValidator  *auth.APIKeyValidator
	AuthletWiring *authletas.Wiring // optional; nil = API-key-only path
	Memory        *service.MemoryService
	UIClientID    string

	// ImportJobs backs the admin async-import surface; ImportMaxUploadBytes caps
	// each uploaded archive (config.ImportMaxUploadBytes).
	ImportJobs           importJobStore
	ImportMaxUploadBytes int64

	// InstanceConfig + GlobalConfig back the admin global-config surface; the
	// hardening middleware reads GlobalConfig live per request, and PATCH
	// refreshes it so writes apply without a restart.
	InstanceConfig instanceConfigStore
	GlobalConfig   globalConfigAccessor

	// SetLogLevel applies a validated slog level name to the running handler's
	// shared LevelVar, so a PATCH of log_level takes effect live.
	SetLogLevel func(level string)

	// PublicBaseURL is the server's external origin (scheme+host, no trailing
	// slash); the UI's OAuth config is derived from it so login works on any host.
	PublicBaseURL string
}

Deps is the dependency bundle for NewHandler; callers build it, NewHandler wires it.

Jump to

Keyboard shortcuts

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