cmd

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmd serves the web UI, and its configuration, alongside the API, when the server is built with the "frontend" tag, which embeds the UI, once it's built, with npm, into build/frontend, which make does. Without it, such as with go install, the server serves the API, without the UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Prefix  string `json:"prefix" help:"Path prefix of the API, such as /api"`
	Version string `json:"version,omitempty" help:"Version of the server"`
	OpenAPI string `json:"openapi,omitempty" help:"Path of the API's documentation, when it's served"`
}

Config is the configuration of the web UI, which it reads from /config.json

type Flags

type Flags struct {
	UI bool `name:"ui" help:"Serve the web UI from this server, when it's built in." default:"true" negatable:""`
}

Flags are the web UI's flags

func (*Flags) RegisterUI

func (f *Flags) RegisterUI(ctx context.Context, log *slog.Logger, router *httprouter.Router, openapi bool) error

RegisterUI registers the web UI, when it's built in, and its configuration, unless the UI isn't to be served. When openapi is set, the server serves the API's documentation, at {prefix}/openapi.html, which the UI links to.

Jump to

Keyboard shortcuts

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