Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProviderCatalog = make(map[string]ConfigProviderFactory)
ProviderCatalog keeps track of config providers by name
Functions ¶
func GetCheckConfigFromFile ¶
GetCheckConfigFromFile returns an instance of check.Config if `fpath` points to a valid config file
func RegisterProvider ¶
func RegisterProvider(name string, factory ConfigProviderFactory)
RegisterProvider adds a loader to the providers catalog
Types ¶
type ADEntryIndex ¶
ADEntryIndex structure to store indeces to backend entries
type ConfigProvider ¶
ConfigProvider is the interface that wraps the Collect method
Collect is responsible of populating a list of CheckConfig instances by retrieving configuration patterns from external resources: files on disk, databases, environment variables are just few examples.
Any type implementing the interface will take care of any dependency or data needed to access the resource providing the configuration.
type ConfigProviderFactory ¶
type ConfigProviderFactory func(cfg config.ConfigurationProviders) (ConfigProvider, error)
ConfigProviderFactory is any function capable to create a ConfigProvider instance
type FileConfigProvider ¶
type FileConfigProvider struct {
// contains filtered or unexported fields
}
FileConfigProvider collect configuration files from disk
func NewFileConfigProvider ¶
func NewFileConfigProvider(paths []string) *FileConfigProvider
NewFileConfigProvider creates a new FileConfigProvider searching for configuration files on the given paths
func (*FileConfigProvider) Collect ¶
func (c *FileConfigProvider) Collect() ([]check.Config, error)
Collect scans provided paths searching for configuration files. When found, it parses the files and try to unmarshall Yaml contents into a CheckConfig instance
func (*FileConfigProvider) String ¶
func (c *FileConfigProvider) String() string