(untested) Merge commit e56ad81 from https://github.com/jzelinskie/chihaya

* rename/replace redis keys
This commit is contained in:
Lawrence, Rendall
2022-04-14 19:12:33 +03:00
parent 05fe8e113a
commit 5c2471ca9b
23 changed files with 560 additions and 564 deletions
+13
View File
@@ -7,6 +7,7 @@ import (
"errors"
"net/http"
"net/http/pprof"
"net/netip"
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -20,6 +21,18 @@ type Server struct {
srv *http.Server
}
// AddressFamily returns the label value for reporting the address family of an IP address.
func AddressFamily(ip netip.Addr) string {
switch {
case ip.Is4(), ip.Is4In6():
return "IPv4"
case ip.Is6():
return "IPv6"
default:
return "<unknown>"
}
}
// Stop shuts down the server.
func (s *Server) Stop() stop.Result {
c := make(stop.Channel)