Documentation ¶
Overview ¶
Package conf contains code related to the configuration of the tool, which in turns specifies which upstream sources to fetch statements from, which sources are trusted, and how to merge statements according to one or more strategies
Index ¶
- type Configuration
- func (c *Configuration) Backend() string
- func (c *Configuration) ExportDenylist() []string
- func (c *Configuration) ExportScripts() []ExportScript
- func (c *Configuration) Policies() []Policy
- func (c *Configuration) Sources() []Source
- func (c *Configuration) Validate() (ok bool, err error)
- func (c *Configuration) Version() string
- type ExportScript
- type Parser
- type Policy
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
A Configuration encapsulates the relevant fields of configurations objects. This is used to hide the different configuration schema versions an provide a general API. This is the type that is ready everywere in the other packages.
func (*Configuration) Backend ¶
func (c *Configuration) Backend() string
Backend returns the backend from which to export
func (*Configuration) ExportDenylist ¶
func (c *Configuration) ExportDenylist() []string
ExportDenylist returns the ExportScripts to generate
func (*Configuration) ExportScripts ¶
func (c *Configuration) ExportScripts() []ExportScript
ExportScripts returns the ExportScripts to generate
func (*Configuration) Policies ¶
func (c *Configuration) Policies() []Policy
Policies returns the Policies from which to export
func (*Configuration) Sources ¶
func (c *Configuration) Sources() []Source
Sources returns the sources (as a slice)
func (*Configuration) Validate ¶
func (c *Configuration) Validate() (ok bool, err error)
Validate checks consistency of configuration
func (*Configuration) Version ¶
func (c *Configuration) Version() string
Version returns the configuration schema version
type ExportScript ¶
ExportScript defines how to generate import scripts for a set of statements
type Parser ¶
Parser is responsible for parsing the configuration file in order to generate a configuration object
func (*Parser) Parse ¶
func (p *Parser) Parse() (config Configuration, err error)
Parse parses the configuration file according to the version specified This method produces as output a Configuration object that hides the differences in the configuration schema versions. All the logic to handle different versions should be invisible to the client of Configuration instances.
func (*Parser) SetConfigFile ¶
SetConfigFile allows to inject an additional config file overriding what was set previously
type Policy ¶
type Policy int
A Policy determines how statements from different source repositories are to be merged (reconciled, when conflicting)
func PolicyFromString ¶
PolicyFromString converts a policy name into a Policy instance