api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package api is the thin driving adapter between the generated strict HTTP server (package apigen) and the engine. Every handler follows the same shape: convert the request, call exactly one engine method, convert the result or classify the error into a Problem-shaped response. No business logic lives here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(e *engine.Engine) http.Handler

Handler returns the complete net/http handler for the API, mounted under no particular prefix (the caller mounts it at /api/v1), with no PDF printer.

func New

func New(e *engine.Engine, deps Deps) http.Handler

New returns the complete net/http handler for the API over the given engine and dependencies.

Types

type Deps

type Deps struct {
	Printer printer.Printer
}

Deps is what a Server needs beyond the engine.

type Server

type Server struct {
	Engine  *engine.Engine
	Printer printer.Printer
}

Server implements apigen.StrictServerInterface over an *engine.Engine. Printer is the port a PDF goes through; nil means printer.None.

func (*Server) ApplyRef

ApplyRef includes one manifest, or many, in the live state. Many in one call, because one at a time was quadratic and felt it (Programme Lead, 2026-09-29): the engine reloads and reindexes once for the batch.

func (*Server) DeleteManifest

DeleteManifest excludes a manifest from the live state (any kind).

func (*Server) DiscardWorking

PutWorking saves a manifest's working copy without creating a version (autosave). DiscardWorking throws away a staged draft. Nothing is returned: the caller reads the manifest back, and what comes back is whatever the vault holds — the saved file, or nothing if it was never saved.

func (*Server) GetCharterPdf

GetCharterPdf prints the charter of a project, programme or operation to PDF. A project prints its working copy when asked, otherwise its latest version, and its working copy when it has no version yet: somebody exporting a draft wants the draft, not a refusal.

func (*Server) GetGapChecks

GetProgrammeChecks mirrors the goal's shape rather than the project's: a flat list, no blocking count, because none of a programme's checks blocks anything.

func (*Server) GetOperationCharterHtml

GetOperationCharterHtml renders an operation as its service description.

func (*Server) GetOperationChecks

GetOperationChecks: the same flat, advisory shape as a programme's.

func (*Server) GetProgrammeCharterHtml

GetProgrammeCharterHtml renders a programme as a document.

func (*Server) GetVault

GetVault returns the state manifest: what the live state includes.

func (*Server) GetWorking

GetWorking returns the working copy as last saved, decoded through the engine's codec, or 404 when the manifest has none.

func (*Server) ListExcluded

ListExcluded lists every excluded manifest, newest first.

func (*Server) ListSnapshots

ListSnapshots returns every snapshot (version) across all kinds, newest first.

func (*Server) ListUnapplied

ListUnapplied lists manifests present but not in the live state.

func (*Server) PostSnapshot

PostSnapshot records an explicit version of a manifest's current content with a reason (I3.3b). Snapshots the working copy if one exists, otherwise the current version. The author is from Settings.spec.operator.

func (*Server) RecoverRef

RecoverRef re-includes an excluded manifest in the live state.

Directories

Path Synopsis
Package apigen provides primitives to interact with the openapi HTTP API.
Package apigen provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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