mirror of
https://github.com/unpoller/unpoller.git
synced 2026-04-05 08:54:00 -04:00
fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user