Documentation
¶
Overview ¶
Package config contains helper functions for parsing of configuration files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseConfigFromYamlFile ¶
ParseConfigFromYamlFile parses a configuration from a file in yaml format. The file's location is specified by the path parameter, and the resulting config is stored nto a structure specified by the cfg parameter..
Types ¶
type PluginConfig ¶
type PluginConfig interface { // GetValue parse configuration for a plugin a store the results in data. // Argument data is a pointer to instance of a go structure. GetValue(data interface{}) (found bool, err error) // GetConfigName returns usually derived config name from plugin name // PluginName + "-config" GetConfigName() string }
PluginConfig is API for plugins to access configuration.
Aim of this API is to let a particular plugin to bind it's configuration without knowing a particular key name. The key name is injected in flavor (Plugin Name).
func ForPlugin ¶
func ForPlugin(pluginName string) PluginConfig
ForPlugin returns API that is injectable to a particular Plugin to read it's configuration.
It tries to lookup `plugin + "-config"` in flags.