Documentation
¶
Overview ¶
Package outputschema is the registry of the JSON Schemas that describe allbctl's machine-readable output (`--output json`): one schema per document kind, plus the envelope definitions they share. The schemas are the hand-written files under schemas/output, embedded in the binary.
Index ¶
Constants ¶
const APIVersion = "allbctl/v1"
APIVersion is the version of the output contract carried by every document. Changes within one APIVersion are additive.
const BaseURL = "https://aallbrig.github.io/allbctl/schemas/v1/"
BaseURL is where the schemas are published; every schema's $id is BaseURL followed by its file name.
const BundleFile = "bundle.schema.json"
BundleFile is the name the bundle of every schema is published under.
const EnvelopeFile = "envelope.schema.json"
EnvelopeFile is the schema file holding the shared definitions.
Variables ¶
var ErrUnknownKind = errors.New("unknown kind")
ErrUnknownKind is returned (wrapped) when a kind has no schema.
Functions ¶
func Bundle ¶
Bundle returns every schema in one compound schema document: each schema is embedded under $defs with its own $id, so the references between them resolve without fetching anything, and the bundle itself accepts a document of any kind.
func Compiler ¶
func Compiler() (*jsonschema.Compiler, error)
Compiler returns a JSON Schema compiler that knows every embedded schema by its $id and nothing else.
Types ¶
type Kind ¶
type Kind string
Kind names a document: the command that produced it and the shape of its data.
const ( KindStatus Kind = "Status" KindStatusRuntimes Kind = "StatusRuntimes" KindStatusPackages Kind = "StatusPackages" KindStatusProjects Kind = "StatusProjects" KindStatusDatabases Kind = "StatusDatabases" KindStatusNetwork Kind = "StatusNetwork" KindStatusContainers Kind = "StatusContainers" KindStatusSecurity Kind = "StatusSecurity" KindStatusSystemctl Kind = "StatusSystemctl" KindStatusGit Kind = "StatusGit" KindStatusPorts Kind = "StatusPorts" KindStatusCloudNative Kind = "StatusCloudNative" KindStatusCloudNativeAWS Kind = "StatusCloudNativeAws" KindVersion Kind = "Version" KindBootstrapStatus Kind = "BootstrapStatus" )
The kinds of document allbctl emits, one per command.
func Kinds ¶
func Kinds() []Kind
Kinds returns every document kind, the full report first and then in the order of the commands.
func Lookup ¶
Lookup resolves a kind by name, ignoring case, so that a user can type `allbctl schema statusports`.