server

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package server is fort-core's local HTTP/WS API (backlog AO-011): /health, graceful shutdown, and the event/command surface the fort-ui module consumes (the live-feed and command routes are added in Phase 3 on top of this).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Config config.Config
	Engine *engine.Engine
	Store  *store.Store
	Logger *slog.Logger
	// Mount optionally adds extra routes (the fort-ui module, wired in by
	// cmd/fort). core never imports ui — the closure is provided from outside,
	// preserving the core !-> ui seam.
	Mount func(*http.ServeMux)
}

Deps are the server's collaborators. All are optional for the bare /health server; richer routes require engine + store.

type Server

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

Server serves the fort-core API.

func New

func New(d Deps) *Server

New builds a server.

func (*Server) Handler

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

Handler returns the HTTP handler (exposed for tests).

func (*Server) Run

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

Run starts the server and blocks until ctx is canceled, then shuts down gracefully.

Jump to

Keyboard shortcuts

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