api

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 103 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMCPHandler added in v0.14.20

func BuildMCPHandler(version, commit, buildTime string) (*mcp.Handler, context.Context)

BuildMCPHandler initialises the connector layer (DB + connectors bootstrap) and returns a ready-to-serve MCP handler + admin context. Callers must either call ServeStdioOS (for the production stdio path) or ServeStdio with a custom reader/writer (for exec/test paths).

func RunMCPStdio added in v0.5.1

func RunMCPStdio(version, commit, buildTime string)

RunMCPStdio initialises the connector layer and serves MCP JSON-RPC over stdin/stdout. Intended for local clients (Claude Desktop, Cursor).

func SetBuildInfo added in v0.23.3

func SetBuildInfo(wickVersion, commit, builtAt string)

SetBuildInfo wires the static build metadata shown on the System page (wick version, commit, build time) — the same trio wick_info reports. Call before NewServer.

func SetReleaseInfo added in v0.23.3

func SetReleaseInfo(currentVersion, repo, pat string)

SetReleaseInfo wires the release source for the web self-updater. Call before NewServer. currentVersion is the running binary's version string (e.g. app.BuildAppVersion); repo is "owner/repo"; pat is the read-only download token (may be empty for public repos).

Types

type BootGate added in v0.16.12

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

BootGate tracks the set of asynchronous boot steps that must finish before the HTTP surface is opened to users. It replaces the single bootReady bool: each async step Register()s itself while booting and Done()s when finished, and the gate only lifts once EVERY registered step is done. This makes "add another thing that must complete before the app is usable" a two-line change (Register + Done) instead of a fragile single flag that whichever goroutine finishes first might flip too early.

All methods are safe for concurrent use. Ready() and PhaseLabel() are hot (hit on every gated request) so they read lock-free via atomics.

func NewBootGate added in v0.16.12

func NewBootGate(initialPhase string) *BootGate

NewBootGate returns a gate with the given initial phase label key. The gate starts NOT ready; call Register for each async step, then Done as each finishes. If no step is ever registered the gate must be lifted explicitly with MarkReady (used when there is genuinely nothing to wait for).

func (*BootGate) Done added in v0.16.12

func (g *BootGate) Done(name string)

Done marks a registered step finished. When the last pending step completes, the gate flips ready and logs that the gate has lifted. Calling Done for an unregistered or already-done name is a no-op (besides a debug log) so it is safe on every exit path of a goroutine.

func (*BootGate) MarkReady added in v0.16.12

func (g *BootGate) MarkReady(reason string)

MarkReady lifts the gate unconditionally. Used when no async step was registered at all (nothing to wait for) so the server doesn't sit behind the gate forever. No-op if already ready.

func (*BootGate) PhaseLabel added in v0.16.12

func (g *BootGate) PhaseLabel() string

PhaseLabel returns the message for the current phase. Lock-free.

func (*BootGate) Ready added in v0.16.12

func (g *BootGate) Ready() bool

Ready reports whether the gate has lifted. Lock-free; hit per request.

func (*BootGate) Register added in v0.16.12

func (g *BootGate) Register(name string)

Register declares an async boot step the gate must wait for. Call it before the step's goroutine starts work. Logs so the boot timeline is visible.

func (*BootGate) SetPhase added in v0.16.12

func (g *BootGate) SetPhase(phase string)

SetPhase updates the human-readable phase key shown on the gate page.

type Middleware

type Middleware func(http.Handler) http.Handler

type Server

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

func NewServer

func NewServer() *Server

func (*Server) JobsSvc added in v0.12.0

func (s *Server) JobsSvc() *manager.Service

JobsSvc returns the manager.Service the API server owns. Exposed so the single-node `lab all` entrypoint can hand it to worker.RunScheduler — both the HTTP handlers and the cron loop then share one Service, avoiding the double-fire race two independent Services would have.

func (*Server) Run

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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