Rename HealthcheckParams and HealthcheckResponse to avoid stuttering

This commit is contained in:
2026-01-08 02:25:28 -08:00
parent 43e4172fb3
commit ad89bd9232

View File

@@ -13,8 +13,8 @@ import (
"sneak.berlin/go/pixa/internal/logger"
)
// HealthcheckParams defines dependencies for Healthcheck.
type HealthcheckParams struct {
// Params defines dependencies for Healthcheck.
type Params struct {
fx.In
Globals *globals.Globals
Config *config.Config
@@ -31,7 +31,7 @@ type Healthcheck struct {
}
// New creates a new Healthcheck instance.
func New(lc fx.Lifecycle, params HealthcheckParams) (*Healthcheck, error) {
func New(lc fx.Lifecycle, params Params) (*Healthcheck, error) {
s := &Healthcheck{
log: params.Logger.Get(),
globals: params.Globals,
@@ -52,8 +52,8 @@ func New(lc fx.Lifecycle, params HealthcheckParams) (*Healthcheck, error) {
return s, nil
}
// HealthcheckResponse is the JSON response for health checks.
type HealthcheckResponse struct {
// Response is the JSON response for health checks.
type Response struct {
Status string `json:"status"`
Now string `json:"now"`
UptimeSeconds int64 `json:"uptime_seconds"`
@@ -68,8 +68,8 @@ func (s *Healthcheck) uptime() time.Duration {
}
// Healthcheck returns the current health status.
func (s *Healthcheck) Healthcheck() *HealthcheckResponse {
resp := &HealthcheckResponse{
func (s *Healthcheck) Healthcheck() *Response {
resp := &Response{
Status: "ok",
Now: time.Now().UTC().Format(time.RFC3339Nano),
UptimeSeconds: int64(s.uptime().Seconds()),