Documentation ¶
Overview ¶
Package config provides the functionality to parse a commonrepo configuration file
Package config provides config parsing and other helpers
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRenameInvalid = errors.New("rename entry is not valid")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Include []string // File globs to include Exclude []string // File globs to exclude Template []string // File globs to treat as templates TemplateVars map[string]interface{} // Map of template variables Install []Install // List of tool versions to install InstallFrom string // Path to install from InstallWith []string // Priority list of install managers to use Rename []Rename // Rename regex rules to apply to files Upstream []Upstream // List of upstream CommonRepos }
Config provides the desired configuration for the commonrepo
func ParseConfig ¶
ParseConfig takes yaml data and returns a Config instance
func (*Config) ApplyRename ¶
ApplyRename modifies the given path according to the rename rules
type Rename ¶
Rename is a parsed rename structure which transforms paths within the repository
type YamlConfig ¶
type YamlConfig struct { // Source options YamlSource `yaml:",inline"` Template []string `yaml:"template"` Install []map[string]string `yaml:"install"` InstallFrom string `yaml:"install-from"` InstallWith []string `yaml:"install-with"` // Consumer options Upstream []yamlUpstream `yaml:"upstream"` TemplateVars map[string]interface{} `yaml:"template-vars"` // contains filtered or unexported fields }
func YamlParse ¶
func YamlParse(data []byte) (config *YamlConfig, err error)
YamlParse returns a YamlConfig instance from the given data
func (*YamlConfig) Unmarshal ¶
func (config *YamlConfig) Unmarshal(data []byte) (err error)
Unmarshal data into this YamlConfig
Click to show internal directories.
Click to hide internal directories.