aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flags.go41
-rw-r--r--go.mod3
-rw-r--r--go.sum2
-rw-r--r--main.go3
4 files changed, 6 insertions, 43 deletions
diff --git a/flags.go b/flags.go
deleted file mode 100644
index e718370..0000000
--- a/flags.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package main
-
-import (
- "fmt"
- "strings"
-)
-
-type MapVar map[string]string
-type SliceVar []string
-
-func (this *MapVar) Set(value string) error {
- if *this == nil {
- *this = make(map[string]string)
- }
-
- splits := strings.SplitN(value, "=", 2)
-
- (*this)[splits[0]] = splits[1]
-
- return nil
-}
-
-func (this *MapVar) String() string {
- slice := []string{}
-
- for key, value := range *this {
- slice = append(slice, fmt.Sprintf("%s: %v,", key, value))
- }
-
- return fmt.Sprintf("{%s}", strings.Join(slice, ","))
-}
-
-func (this *SliceVar) Set(value string) error {
- *this = append(*this, value)
-
- return nil
-}
-
-func (this *SliceVar) String() string {
- return fmt.Sprintf("[%s]", strings.Join(*this, ","))
-}
diff --git a/go.mod b/go.mod
index fd03978..70f40f8 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module main
-go 1.22.9
+go 1.23.2
require github.com/prometheus/client_golang v1.20.5
@@ -134,6 +134,7 @@ require (
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 // indirect
gioui.org v0.0.0-20210308172011-57750fc8a0a6 // indirect
git.sr.ht/~sbinet/gg v0.3.1 // indirect
+ git.tyil.nl/go/flags_list.git v0.0.0-20241128131002-f63b54d9a316 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 // indirect
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect
diff --git a/go.sum b/go.sum
index 976d666..a5cbf0b 100644
--- a/go.sum
+++ b/go.sum
@@ -180,6 +180,8 @@ cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcP
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
+git.tyil.nl/go/flags_list.git v0.0.0-20241128131002-f63b54d9a316 h1:blfE82Ju8apYh48jFnTz+aNfaNc6QX8Ks/lRh+5ZtTo=
+git.tyil.nl/go/flags_list.git v0.0.0-20241128131002-f63b54d9a316/go.mod h1:6wQZDbWAlM6ff+IabJvU7Bo16E/s+sjIug9kBtUt0dw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
diff --git a/main.go b/main.go
index 109b5cc..db9c998 100644
--- a/main.go
+++ b/main.go
@@ -13,6 +13,7 @@ import (
"strconv"
"time"
+ "git.tyil.nl/go/flags_list.git"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@@ -24,7 +25,7 @@ var (
namespace string
path string
subsystem string
- customLabels MapVar
+ customLabels flags_list.MapVar
extensionKeys map[string]bool
gauges map[string]*prometheus.GaugeVec