From 9c3636f31a5e59ae84208488902283ed8418e6fd Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 26 May 2026 16:17:54 +0200 Subject: [PATCH] style: align struct fields in config, domain, and auth --- internal/auth/service/service.go | 4 ++-- internal/config/config.go | 13 ++++++------- internal/domain/audit.go | 15 +++++++-------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/internal/auth/service/service.go b/internal/auth/service/service.go index 291857f..ecc0cff 100644 --- a/internal/auth/service/service.go +++ b/internal/auth/service/service.go @@ -18,8 +18,8 @@ import ( ) type authService struct { - repo domain.AuthRepository - auditSvc domain.AuditService + repo domain.AuthRepository + auditSvc domain.AuditService } func NewAuthService(repo domain.AuthRepository, auditSvc domain.AuditService) domain.AuthService { diff --git a/internal/config/config.go b/internal/config/config.go index cffb1d6..23cc2c5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -37,12 +37,12 @@ type Config struct { func Load() (Config, error) { cfg := Config{ - Port: firstNonEmpty(strings.TrimSpace(os.Getenv("PORT")), "3000"), - GinMode: strings.TrimSpace(os.Getenv("GIN_MODE")), - DatabaseFile: firstNonEmpty(strings.TrimSpace(os.Getenv("DATABASE_FILE")), "mal.db"), - CORSAllowAll: strings.TrimSpace(os.Getenv("MAL_CORS_ALLOW_ALL")) == "1", - PlaybackProxySecret: strings.TrimSpace(os.Getenv("PLAYBACK_PROXY_SECRET")), - JikanTrace: truthy(strings.TrimSpace(os.Getenv("MAL_JIKAN_TRACE"))), + Port: firstNonEmpty(strings.TrimSpace(os.Getenv("PORT")), "3000"), + GinMode: strings.TrimSpace(os.Getenv("GIN_MODE")), + DatabaseFile: firstNonEmpty(strings.TrimSpace(os.Getenv("DATABASE_FILE")), "mal.db"), + CORSAllowAll: strings.TrimSpace(os.Getenv("MAL_CORS_ALLOW_ALL")) == "1", + PlaybackProxySecret: strings.TrimSpace(os.Getenv("PLAYBACK_PROXY_SECRET")), + JikanTrace: truthy(strings.TrimSpace(os.Getenv("MAL_JIKAN_TRACE"))), EpisodeAvailabilityMode: EpisodeAvailabilityModeAuto, } @@ -82,4 +82,3 @@ func truthy(v string) bool { return false } } - diff --git a/internal/domain/audit.go b/internal/domain/audit.go index 60ef37c..49ec37f 100644 --- a/internal/domain/audit.go +++ b/internal/domain/audit.go @@ -6,16 +6,15 @@ import ( ) type AuditEvent struct { - UserID string - Action string - ResourceType string - ResourceID string - MetadataJSON json.RawMessage - IP string - UserAgent string + UserID string + Action string + ResourceType string + ResourceID string + MetadataJSON json.RawMessage + IP string + UserAgent string } type AuditService interface { Record(ctx context.Context, event AuditEvent) error } -