add domain whois/dns support, refactor codebase

This commit is contained in:
2025-09-17 20:38:51 +02:00
parent 477bc242aa
commit 16fc344a68
29 changed files with 1396 additions and 867 deletions
+22
View File
@@ -0,0 +1,22 @@
package utils
import (
"log/slog"
"net/http"
)
// HealthCheck Returns a simple health check handler.
func HealthCheck() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
_, err := w.Write([]byte("OK"))
if err != nil {
slog.Warn("failed to write healthcheck response",
"component", "healthcheck",
"method", r.Method,
"path", r.URL.Path,
"error", err,
)
}
})
}
-15
View File
@@ -1,15 +0,0 @@
package utils
import (
"net/http"
)
// Returns a simple health check handler
func HealthCheck() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
})
return mux
}
@@ -4,7 +4,7 @@ import (
"net"
)
// Contains a list of known bogon IP ranges
// BogonNets Contains a list of known bogon IP ranges
var BogonNets = []*net.IPNet{
// IPv4
{IP: net.IPv4(0, 0, 0, 0), Mask: net.CIDRMask(8, 32)}, // "This" network