summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/agent/confgroup/registry.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/go/collectors/go.d.plugin/agent/confgroup/registry.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/registry.go b/src/go/collectors/go.d.plugin/agent/confgroup/registry.go
new file mode 100644
index 000000000..295a75129
--- /dev/null
+++ b/src/go/collectors/go.d.plugin/agent/confgroup/registry.go
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package confgroup
+
+type Registry map[string]Default
+
+type Default struct {
+ MinUpdateEvery int `yaml:"-"`
+ UpdateEvery int `yaml:"update_every"`
+ AutoDetectionRetry int `yaml:"autodetection_retry"`
+ Priority int `yaml:"priority"`
+}
+
+func (r Registry) Register(name string, def Default) {
+ if name != "" {
+ r[name] = def
+ }
+}
+
+func (r Registry) Lookup(name string) (Default, bool) {
+ def, ok := r[name]
+ return def, ok
+}