cmd

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 5 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 the server's configuration, which it reads, beside the API, when the server is built with the "frontend" tag, which embeds the UI, once it's built, with npm, into frontend/dist, which make does. Without it, such as with go install, the server serves its API and configuration, without the UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuiltIn

func BuiltIn() bool

BuiltIn returns whether the web UI is built in, with the "frontend" tag

Types

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 server.Cmd, log *slog.Logger, router *httprouter.Router, openapi bool, opts ...config.Opt) (bool, error)

RegisterUI registers the server's configuration, at /config.json, and the web UI, at /, when it's built in, unless it isn't to be served. When openapi is true, the configuration says where the API's documentation is. The options add the modules' sections to the configuration, such as what the credential manager can do. Returns true when the UI is served, so the server doesn't register its own handler of /.

Jump to

Keyboard shortcuts

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