manifest

package
v1.0.65 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindCommandManifest = "command-manifest"
	KindCommandIndex    = "command-index"

	MaxManifestBytes        = 16 * 1024 * 1024
	MaxCommandsPerManifest  = 10000
	MaxFlagsPerCommand      = 200
	MaxManifestStringBytes  = 8192
	MaxAnnotationValues     = 100
	MaxAnnotationValueBytes = 8192
)

Variables

This section is empty.

Functions

func CanonicalCommandPath

func CanonicalCommandPath(path string) string

func WriteFile

func WriteFile(path, kind string, m Manifest) error

Types

type Command

type Command struct {
	Path          string   `json:"path"`
	CanonicalPath string   `json:"canonical_path,omitempty"`
	Domain        string   `json:"domain,omitempty"`
	Use           string   `json:"use"`
	Short         string   `json:"short,omitempty"`
	Example       string   `json:"example,omitempty"`
	Hidden        bool     `json:"hidden,omitempty"`
	Runnable      bool     `json:"runnable"`
	Source        Source   `json:"source"`
	Generated     bool     `json:"generated,omitempty"`
	Risk          string   `json:"risk,omitempty"`
	Identities    []string `json:"identities,omitempty"`
	Flags         []Flag   `json:"flags,omitempty"`
	DefaultFields []string `json:"default_fields,omitempty"`
}

type Flag

type Flag struct {
	Name        string              `json:"name"`
	Shorthand   string              `json:"shorthand,omitempty"`
	Usage       string              `json:"usage,omitempty"`
	Hidden      bool                `json:"hidden,omitempty"`
	Required    bool                `json:"required,omitempty"`
	TakesValue  bool                `json:"takes_value"`
	DefValue    string              `json:"default,omitempty"`
	NoOptValue  string              `json:"no_opt_value,omitempty"`
	Annotations map[string][]string `json:"annotations,omitempty"`
}

type Manifest

type Manifest struct {
	SchemaVersion int       `json:"schema_version"`
	Commands      []Command `json:"commands"`
}

func ReadBytes

func ReadBytes(data []byte, kind string) (Manifest, error)

func ReadFile

func ReadFile(path, kind string) (Manifest, error)

func (Manifest) Validate

func (m Manifest) Validate(kind string) error

type Source

type Source string
const (
	SourceBuiltin  Source = "builtin"
	SourceShortcut Source = "shortcut"
	SourceService  Source = "service"
)

Jump to

Keyboard shortcuts

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