diff options
| author | Patrick Spek <p.spek@tyil.nl> | 2024-11-28 14:16:37 +0100 |
|---|---|---|
| committer | Patrick Spek <p.spek@tyil.nl> | 2024-11-28 14:16:37 +0100 |
| commit | f3bef7a8e869f17a44ad95fd3a171403d6360dec (patch) | |
| tree | 98b5fd68edc40a38de087778a494e68d623e20ff | |
| parent | 0686e5e4d1ab5b263c6b128e0db6a0006e6ab497 (diff) | |
| download | fsdir-master.tar.gz fsdir-master.tar.bz2 | |
This was the intention all along, but I wanted to have a working
proof-of-concept for the exporter itself first.
| -rw-r--r-- | flags.go | 41 | ||||
| -rw-r--r-- | go.mod | 3 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | main.go | 3 |
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, ",")) -} @@ -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 @@ -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= @@ -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 |
