outputschema

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 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 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

View Source
const APIVersion = "allbctl/v1"

APIVersion is the version of the output contract carried by every document. Changes within one APIVersion are additive.

View Source
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.

View Source
const BundleFile = "bundle.schema.json"

BundleFile is the name the bundle of every schema is published under.

View Source
const EnvelopeFile = "envelope.schema.json"

EnvelopeFile is the schema file holding the shared definitions.

Variables

View Source
var ErrUnknownKind = errors.New("unknown kind")

ErrUnknownKind is returned (wrapped) when a kind has no schema.

Functions

func Bundle

func Bundle() ([]byte, error)

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.

func File

func File(name string) ([]byte, error)

File returns the content of one embedded schema file.

func Files

func Files() ([]string, error)

Files returns the name of every embedded schema file, sorted.

func Schema

func Schema(kind Kind) ([]byte, error)

Schema returns the JSON Schema of a kind, exactly as published.

func Validate

func Validate(kind Kind, document []byte) error

Validate checks a JSON document against the schema of kind. The error lists every violation.

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

func Lookup(name string) (Kind, error)

Lookup resolves a kind by name, ignoring case, so that a user can type `allbctl schema statusports`.

func (Kind) FileName

func (k Kind) FileName() string

FileName is the name of the kind's schema file, both under schemas/output and where the schemas are published.

func (Kind) ID

func (k Kind) ID() string

ID is the kind's schema $id: the URL it is published at.

Jump to

Keyboard shortcuts

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