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
ExtractionOnly bool `yaml:"extraction_only,omitempty"` // arg is only used for output extraction, not passed to command
}
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
Extract *Extract `yaml:"extract,omitempty"`
}
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 Extract ¶ added in v0.4.0
type Extract struct {
Type string `yaml:"type"` // raw, json, line_prefix, regex, json_array, template
Field string `yaml:"field,omitempty"` // for json: field name to extract
Prefix string `yaml:"prefix,omitempty"` // for line_prefix: prefix to match
Pattern string `yaml:"pattern,omitempty"` // for regex: pattern with capture group; for template: path pattern with {package}
ArrayField string `yaml:"array_field,omitempty"` // for json_array: array field to search
MatchField string `yaml:"match_field,omitempty"` // for json_array: field to match against pkg name
ExtractField string `yaml:"extract_field,omitempty"` // for json_array: field to extract from matched element
StripFilename bool `yaml:"strip_filename,omitempty"` // remove filename from path, returning directory
}
type VersionDetection ¶
Click to show internal directories.
Click to hide internal directories.