server

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bind          string
	DashboardBind string
	DataDir       string
	AuthToken     string
}

Config holds server configuration.

type Server

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

Server is the Koor HTTP server.

func New

func New(cfg Config, stateStore *state.Store, specReg *specs.Registry, eventBus *events.Bus, instanceReg *instances.Registry, mcpHandler http.Handler, logger *slog.Logger) *Server

New creates a new Server.

func (*Server) DashboardHandler

func (s *Server) DashboardHandler() http.Handler

DashboardHandler returns the HTTP handler for the dashboard (separate port). It proxies /api/* and /health to the API server, serves HTMX rules pages, and embedded static files.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the root HTTP handler with all routes and auth middleware.

func (*Server) ListenAndServe

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

ListenAndServe starts the API server and optionally the dashboard server. It blocks until the context is cancelled.

func (*Server) SetAudit

func (s *Server) SetAudit(a *audit.Log)

SetAudit attaches an audit log.

func (*Server) SetCompliance

func (s *Server) SetCompliance(c *compliance.Scheduler)

SetCompliance attaches a compliance scheduler.

func (*Server) SetLiveness

func (s *Server) SetLiveness(m *liveness.Monitor)

SetLiveness attaches a liveness monitor to the server for the /api/liveness endpoints.

func (*Server) SetObservability

func (s *Server) SetObservability(o *observability.Store)

SetObservability attaches an observability metrics store.

func (*Server) SetTemplates

func (s *Server) SetTemplates(t *templates.Store)

SetTemplates attaches a template store.

func (*Server) SetWebhooks

func (s *Server) SetWebhooks(d *webhooks.Dispatcher)

SetWebhooks attaches a webhook dispatcher.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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