Documentation
¶
Index ¶
Constants ¶
const ( // Online is the status of a service that is online. Online string = "Online" // Offline is the status of a service that is offline. Offline string = "Offline" )
Variables ¶
This section is empty.
Functions ¶
func AnonymizeIP ¶
AnonymizeIP anonymizes the last two octets of an IPv4 address or the last 80 bits of an IPv6 address.
Types ¶
type AnonymizedIPHandler ¶
type AnonymizedIPHandler struct {
// contains filtered or unexported fields
}
AnonymizedIPHandler is an HTTP handler for the /ip/anonymized endpoint.
func NewAnonymizedIPHandler ¶
func NewAnonymizedIPHandler(cfg *config.Config, db *database.DB, logger *zap.Logger) *AnonymizedIPHandler
NewAnonymizedIPHandler creates a new AnonymizedIPHandler instance.
func (*AnonymizedIPHandler) Handle ¶
func (h *AnonymizedIPHandler) Handle(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ServeHTTP serves the /ip/anonymized endpoint.
type HashedIPHandler ¶
type HashedIPHandler struct {
// contains filtered or unexported fields
}
HashedIPHandler is an HTTP handler for the /ip/hashed endpoint.
func NewHashedIPHandler ¶
NewHashedIPHandler returns a new HashedIPHandler instance.
func (*HashedIPHandler) Handle ¶
func (h *HashedIPHandler) Handle(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ServeHTTP serves the /ip/hashed endpoint.
type HealthHandler ¶
type HealthHandler struct {
// contains filtered or unexported fields
}
HealthHandler is an HTTP handler for the /health endpoint.
func NewHealthHandler ¶
func NewHealthHandler(db *database.DB, logger *zap.Logger) *HealthHandler
NewHealthHandler creates a new HealthHandler instance.
func (*HealthHandler) Handle ¶
func (h *HealthHandler) Handle(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
ServeHTTP serves the /health endpoint.
type HeartbeatHandler ¶
type HeartbeatHandler struct {
// contains filtered or unexported fields
}
HeartbeatHandler is an HTTP handler for the /heartbeat endpoint.
func NewHeartbeatHandler ¶
func NewHeartbeatHandler(logger *zap.Logger) *HeartbeatHandler
NewHeartbeatHandler creates a new HeartbeatHandler instance.
func (*HeartbeatHandler) Handle ¶
func (h *HeartbeatHandler) Handle(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
ServeHTTP serves the /heartbeat endpoint.
type IPHandler ¶
type IPHandler struct {
// contains filtered or unexported fields
}
IPHandler is an HTTP handler for the /ip endpoint.
func NewIPHandler ¶
NewIPHandler creates a new IPHandler instance.
func (*IPHandler) Handle ¶
func (h *IPHandler) Handle(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ServeHTTP serves the /ip endpoint.
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
MetricsHandler is an HTTP handler for the /metrics endpoint.
func NewMetricsHandler ¶
func NewMetricsHandler(db *database.DB, logger *zap.Logger) *MetricsHandler
NewMetricsHandler creates a new MetricsHandler instance.
func (*MetricsHandler) Handle ¶
func (h *MetricsHandler) Handle(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
ServeHTTP serves the /metrics endpoint.