server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package server is Console's HTTP layer. It exposes a JSON API over the flag and status engines and a small server-rendered dashboard (htmx) on top of the same App. It owns no business logic: every handler is a thin adapter that decodes a request, calls an engine, and encodes the result.

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 wires an App to an http.ServeMux and the dashboard templates. Construct it with New, register routes with Routes, and obtain the wrapped handler with Handler.

func New

func New(a *app.App) *Server

New builds a Server over a. It parses the embedded dashboard templates and registers all routes; the returned Server is ready to serve.

func (*Server) Handler

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

Handler returns the mux wrapped with logging + panic-recovery middleware.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

ListenAndServe serves the dashboard and API on addr until the process exits.

func (*Server) Routes

func (s *Server) Routes()

Routes registers every API and UI route on the mux. It is safe to call once during construction.

Jump to

Keyboard shortcuts

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