blob: 3836d201a32146607677c1aaa9603ec8ec698aa6 (
plain)
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
|
// SPDX-License-Identifier: GPL-3.0-or-later
package file
import (
"errors"
"github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup"
)
type Config struct {
Registry confgroup.Registry
Read []string
Watch []string
}
func validateConfig(cfg Config) error {
if len(cfg.Registry) == 0 {
return errors.New("empty config registry")
}
if len(cfg.Read)+len(cfg.Watch) == 0 {
return errors.New("discoverers not set")
}
return nil
}
|