definitions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Position    int    `yaml:"position"`
	Required    bool   `yaml:"required"`
	Validate    string `yaml:"validate,omitempty"`
	Flag        string `yaml:"flag,omitempty"`
	Suffix      string `yaml:"suffix,omitempty"`       // append user value with this prefix, e.g. "@" for pkg@version
	FixedSuffix string `yaml:"fixed_suffix,omitempty"` // always append this suffix, e.g. "@none" for go remove
}

type Command

type Command struct {
	Base          []string            `yaml:"base"`
	BaseOverrides map[string][]string `yaml:"base_overrides,omitempty"` // flag name -> replacement base
	Args          map[string]Arg      `yaml:"args,omitempty"`
	Flags         map[string]Flag     `yaml:"flags,omitempty"`
	DefaultFlags  []string            `yaml:"default_flags,omitempty"`
	ExitCodes     map[int]string      `yaml:"exit_codes,omitempty"`
	Then          []Command           `yaml:"then,omitempty"` // commands to run after this one
}

type Definition

type Definition struct {
	Name             string             `yaml:"name"`
	Ecosystem        string             `yaml:"ecosystem"`
	Binary           string             `yaml:"binary"`
	Version          string             `yaml:"version,omitempty"`
	Status           string             `yaml:"status,omitempty"`
	MinTested        string             `yaml:"min_tested,omitempty"`
	MaxTested        string             `yaml:"max_tested,omitempty"`
	Detection        Detection          `yaml:"detection"`
	VersionDetection VersionDetection   `yaml:"version_detection,omitempty"`
	Commands         map[string]Command `yaml:"commands"`
	Capabilities     []string           `yaml:"capabilities"`
}

func LoadEmbedded

func LoadEmbedded() ([]*Definition, error)

func LoadFromBytes

func LoadFromBytes(data []byte) (*Definition, error)

type Detection

type Detection struct {
	Lockfiles  []string    `yaml:"lockfiles,omitempty"`
	Manifests  []string    `yaml:"manifests,omitempty"`
	Priority   int         `yaml:"priority"`
	FileChecks []FileCheck `yaml:"file_checks,omitempty"`
}

type FileCheck

type FileCheck struct {
	File    string `yaml:"file"`
	Exists  bool   `yaml:"exists,omitempty"`
	Match   string `yaml:"match,omitempty"`
	Version string `yaml:"version,omitempty"`
}

type Flag

type Flag struct {
	Values []FlagValue
}

func (*Flag) UnmarshalYAML

func (f *Flag) UnmarshalYAML(unmarshal func(interface{}) error) error

type FlagValue

type FlagValue struct {
	Literal string
	Field   string
	Join    string // if set, join literal and field value with this (e.g., "=" for --flag=value)
}

type Validator

type Validator struct {
	Pattern   string `yaml:"pattern"`
	MaxLength int    `yaml:"max_length,omitempty"`
}

type VersionDetection

type VersionDetection struct {
	Command []string `yaml:"command,omitempty"`
	Pattern string   `yaml:"pattern,omitempty"`
}

Jump to

Keyboard shortcuts

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