Documentation
¶
Overview ¶
Package config defines the config file and load methods
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Version int `yaml:"version" json:"version"`
Files map[string]*File `yaml:"files" json:"files"`
Processors map[string]*Processor `yaml:"processors" json:"processors"`
Scans map[string]*Scan `yaml:"scans" json:"scans"`
Sources map[string]*Source `yaml:"sources" json:"sources"`
}
Config contains the configuration options for the project
func LoadReader ¶
LoadReader imports a config from a reader.
type File ¶
type File struct {
Name string `yaml:"-" json:"-"` // Name is a filename or glob to match against
Processors []string `yaml:"processors" json:"processors"` // Processors to run on a given file
Scans []string `yaml:"scans" json:"scans"` // Deprecated: Scans are Scan names to apply to the file
}
File defines a file to process for version bumps.
type Filter ¶
type Filter struct {
Expr string `yaml:"expr" json:"expr"` // Regexp to match, Go templating is enabled on this
}
Filter defines how items are filtered in from the source. By default, all items are included.
type Processor ¶
type Processor struct {
Name string `yaml:"-" json:"-"` // Name of the processor
Scan string `yaml:"scan" json:"scan"` // Scanner to use
ScanArgs map[string]string `yaml:"scanArgs" json:"scanArgs"` // Args to scanner
Source string `yaml:"source" json:"source"` // Source to use
SourceArgs map[string]string `yaml:"sourceArgs" json:"sourceArgs"` // Args to source
Key string `yaml:"key" json:"key"` // Key is a unique value to store in a lock file
Filter Filter `yaml:"filter" json:"filter"` // Filter specifies which items to include from the source
Sort Sort `yaml:"sort" json:"sort"` // Sort is used to pick from multiple results
Template string `yaml:"template" json:"template"` // Template is used to output the version
}
Processor scans with a selected scanner and source.
type Scan ¶
type Scan struct {
Name string `yaml:"-" json:"-"` // Name is the name of the scan entry
Type string `yaml:"type" json:"type"` // Type is the method for scanning the file
Args map[string]string `yaml:"args" json:"args"` // Args provide additional options used by scanners, sources, and templating
Source string `yaml:"source" json:"source"` // Deprecated: Source is the name of the source for updating the version
}
Scan defines how to search a file for versions.
type Sort ¶
type Sort struct {
Method string `yaml:"method" json:"method"` // Sorting methods include: semver, numeric, or unset for an ascii sort
Asc bool `yaml:"asc" json:"asc"` // Sort values ascending (smallest number first)
Offset int `yaml:"offset" json:"offset"` // Offset within the sorted values to pick
Template string `yaml:"template" json:"template"` // Preprocess value to be sorted, this does not effect the resulting version number only the sorting
}
Sort defines how multiple results should be filtered and sorted. By default, sort returns the 0 offset of a descending sort.
type Source ¶
type Source struct {
Name string `yaml:"-" json:"-"` // Name is the name of the source entry
Type string `yaml:"type" json:"type"` // Type is the method used to query the source
Args map[string]string `yaml:"args" json:"args"` // Args provide additional options used by sources
Key string `yaml:"key" json:"key"` // Deprecated: Key is a unique value to store in a lock file
Filter Filter `yaml:"filter" json:"filter"` // Deprecated: Filter specifies which items to include from the source
Sort Sort `yaml:"sort" json:"sort"` // Deprecated: Sort is used to pick from multiple results
Template string `yaml:"template" json:"template"` // Deprecated: Template is used to output the version
}
Source defines how to get the current version.
Click to show internal directories.
Click to hide internal directories.