manifest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package manifest loads and merges YAML command registries.

Index

Constants

This section is empty.

Variables

View Source
var SubcommandCommands = map[string]bool{
	"docker":    true,
	"kubectl":   true,
	"svn":       true,
	"systemctl": true,
	"aws":       true,
}

SubcommandCommands identifies commands that use subcommand-style dispatch (e.g. "docker ps", "kubectl get"). Both the validator and server packages reference this map so they stay in sync.

Functions

func LoadDir

func LoadDir(dir string) (map[string]*Manifest, error)

LoadDir loads manifests from dir (recursive). Skips _-prefixed and non-YAML files.

func LoadEmbedded

func LoadEmbedded() (map[string]*Manifest, error)

func Merge

func Merge(base, overlay map[string]*Manifest) map[string]*Manifest

Merge combines base and overlay; overlay wins on conflict. Does not mutate inputs.

Types

type Flag

type Flag struct {
	Flag          string   `yaml:"flag"`
	Description   string   `yaml:"description"`
	TakesValue    bool     `yaml:"takes_value"`
	PatternValue  bool     `yaml:"pattern_value"`
	AllowedValues []string `yaml:"allowed_values"`
	Deny          bool     `yaml:"deny"`
	Reason        string   `yaml:"reason"`
}

type Manifest

type Manifest struct {
	Name             string   `yaml:"name"`
	Description      string   `yaml:"description"`
	Category         string   `yaml:"category"`
	Timeout          int      `yaml:"timeout"`
	Deny             bool     `yaml:"deny"`
	Reason           string   `yaml:"reason"`
	Flags            []Flag   `yaml:"flags"`
	AllowsPathArgs   bool     `yaml:"allows_path_args"`
	RestrictedPaths  []string `yaml:"restricted_paths"`
	Stdin            bool     `yaml:"stdin"`
	Stdout           bool     `yaml:"stdout"`
	RegexArgPosition *int     `yaml:"regex_arg_position"`
	// contains filtered or unexported fields
}

func (*Manifest) GetFlag

func (m *Manifest) GetFlag(name string) *Flag

type ManifestError

type ManifestError struct {
	Message string
}

func (*ManifestError) Error

func (e *ManifestError) Error() string

Jump to

Keyboard shortcuts

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