summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/agent/discovery/dummy/config.go
blob: 4da80a8dcb1d110ad4787f86a2acba56181b81fb (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
// SPDX-License-Identifier: GPL-3.0-or-later

package dummy

import (
	"errors"

	"github.com/netdata/netdata/go/go.d.plugin/agent/confgroup"
)

type Config struct {
	Registry confgroup.Registry
	Names    []string
}

func validateConfig(cfg Config) error {
	if len(cfg.Registry) == 0 {
		return errors.New("empty config registry")
	}
	if len(cfg.Names) == 0 {
		return errors.New("names not set")
	}
	return nil
}