-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
35 lines (27 loc) · 867 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package wireguardreceiver
import (
"errors"
"github.com/rogercoll/wireguardreceiver/internal/metadata"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/receiver/scraperhelper"
)
var _ component.Config = (*Config)(nil)
type Config struct {
scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
// TODO: implement exclude option
Exclude ExcludeConfig `mapstructure:"exclude"`
// MetricsBuilderConfig config. Enable or disable stats by name.
metadata.MetricsBuilderConfig `mapstructure:",squash"`
}
type ExcludeConfig struct {
Interface ExcludeInterfaceConfig `mapstructure:"interface"`
}
type ExcludeInterfaceConfig struct {
Names []string `mapstructure:"names"`
}
func (c Config) Validate() error {
if c.CollectionInterval == 0 {
return errors.New("config.CollectorInterval must be specified")
}
return nil
}