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 ¶ added in v5.3.0
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 ¶ added in v5.3.0
type GlobWatcher struct {
// contains filtered or unexported fields
}
func NewGlobWatcher ¶ added in v5.3.0
func NewGlobWatcher(glob string) *GlobWatcher
func (*GlobWatcher) Scan ¶ added in v5.3.0
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 ¶ added in v5.3.0
func NewRegistry ¶ added in v5.3.0
func NewRegistry() *Registry
type ReloadConfig ¶ added in v5.3.0
type Reloader ¶ added in v5.3.0
type Reloader struct {
// contains filtered or unexported fields
}
Reloader is used to register and reload modules
func NewReloader ¶ added in v5.3.0
NewReloader creates new Reloader instance for the given config
func (*Reloader) Run ¶ added in v5.3.0
func (rl *Reloader) Run(runnerFactory RunnerFactory)
Run runs the reloader