Documentation ¶
Index ¶
- Variables
- func ChangeDefaultCfgfileFlag(beatName string) error
- func GetPathConfig() string
- func HandleFlags() error
- func IsTestConfig() bool
- func Load(path string) (*common.Config, error)
- func LoadList(file string) ([]*common.Config, error)
- func Read(out interface{}, path string) errordeprecated
- type GlobWatcher
- type Registry
- type Reload
- type ReloadConfig
- type Reloader
- type Runner
- type RunnerFactory
Constants ¶
This section is empty.
Variables ¶
var ( DefaultReloadConfig = ReloadConfig{ Reload: Reload{ Period: 10 * time.Second, Enabled: false, }, } )
Functions ¶
func ChangeDefaultCfgfileFlag ¶
ChangeDefaultCfgfileFlag replaces the value and default value for the `-c` flag so that it reflects the beat name.
func GetPathConfig ¶
func GetPathConfig() string
GetPathConfig returns ${path.config}. If ${path.config} is not set, ${path.home} is returned.
func HandleFlags ¶
func HandleFlags() error
HandleFlags adapts default config settings based on command line flags.
func IsTestConfig ¶
func IsTestConfig() bool
IsTestConfig returns whether or not this is configuration used for testing
func Load ¶
Load reads the configuration from a YAML file structure. If path is empty this method reads from the configuration file specified by the '-c' command line flag.
Types ¶
type GlobWatcher ¶
type GlobWatcher struct {
// contains filtered or unexported fields
}
func NewGlobWatcher ¶
func NewGlobWatcher(glob string) *GlobWatcher
func (*GlobWatcher) Scan ¶
func (gw *GlobWatcher) Scan() ([]string, bool, error)
Scan scans all files matched by the glob and checks if the number of files or the modtime of the files changed It returns the list of files, a boolean if anything in the glob changed and potential errors. To detect changes not only mod time is compared but also the hash of the files list. This is required to also detect files which were removed. The modtime is compared based on second as normally mod-time is in seconds. If it is unclear if something changed the method will return true for the changes. It is strongly recommend to call scan not more frequent then 1s.
type Registry ¶
func NewRegistry ¶
func NewRegistry() *Registry
type ReloadConfig ¶
type Reloader ¶
type Reloader struct {
// contains filtered or unexported fields
}
Reloader is used to register and reload modules
func NewReloader ¶
NewReloader creates new Reloader instance for the given config