This commit is contained in:
davidnewhall2
2019-12-17 02:09:30 -08:00
parent d3d420597e
commit da75406310
4 changed files with 13 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ type Metrics struct {
// Config represents the core library input data.
type Config struct {
Poller `json:"poller" toml:"poller" xml:"poller" yaml:"poller"`
*Poller `json:"poller" toml:"poller" xml:"poller" yaml:"poller"`
}
// Poller is the global config values.
@@ -103,6 +103,7 @@ func (u *UnifiPoller) ParseConfigs() error {
// parseInterface parses the config file and environment variables into the provided interface.
func (u *UnifiPoller) parseInterface(i interface{}) error {
config.ENVTag = "xml" // xml tag is better formatted for slices.
// Parse config file into provided interface.
if err := config.ParseFile(i, u.Flags.ConfigFile); err != nil {
return err

View File

@@ -12,7 +12,7 @@ import (
// New returns a new poller struct.
func New() *UnifiPoller {
return &UnifiPoller{Config: &Config{}, Flags: &Flags{}}
return &UnifiPoller{Config: &Config{Poller: &Poller{}}, Flags: &Flags{}}
}
// Start begins the application from a CLI.