style: align struct fields in config, domain, and auth

This commit is contained in:
2026-05-26 16:17:54 +02:00
parent ff8f760750
commit 9c3636f31a
3 changed files with 15 additions and 17 deletions

View File

@@ -18,8 +18,8 @@ import (
) )
type authService struct { type authService struct {
repo domain.AuthRepository repo domain.AuthRepository
auditSvc domain.AuditService auditSvc domain.AuditService
} }
func NewAuthService(repo domain.AuthRepository, auditSvc domain.AuditService) domain.AuthService { func NewAuthService(repo domain.AuthRepository, auditSvc domain.AuditService) domain.AuthService {

View File

@@ -37,12 +37,12 @@ type Config struct {
func Load() (Config, error) { func Load() (Config, error) {
cfg := Config{ cfg := Config{
Port: firstNonEmpty(strings.TrimSpace(os.Getenv("PORT")), "3000"), Port: firstNonEmpty(strings.TrimSpace(os.Getenv("PORT")), "3000"),
GinMode: strings.TrimSpace(os.Getenv("GIN_MODE")), GinMode: strings.TrimSpace(os.Getenv("GIN_MODE")),
DatabaseFile: firstNonEmpty(strings.TrimSpace(os.Getenv("DATABASE_FILE")), "mal.db"), DatabaseFile: firstNonEmpty(strings.TrimSpace(os.Getenv("DATABASE_FILE")), "mal.db"),
CORSAllowAll: strings.TrimSpace(os.Getenv("MAL_CORS_ALLOW_ALL")) == "1", CORSAllowAll: strings.TrimSpace(os.Getenv("MAL_CORS_ALLOW_ALL")) == "1",
PlaybackProxySecret: strings.TrimSpace(os.Getenv("PLAYBACK_PROXY_SECRET")), PlaybackProxySecret: strings.TrimSpace(os.Getenv("PLAYBACK_PROXY_SECRET")),
JikanTrace: truthy(strings.TrimSpace(os.Getenv("MAL_JIKAN_TRACE"))), JikanTrace: truthy(strings.TrimSpace(os.Getenv("MAL_JIKAN_TRACE"))),
EpisodeAvailabilityMode: EpisodeAvailabilityModeAuto, EpisodeAvailabilityMode: EpisodeAvailabilityModeAuto,
} }
@@ -82,4 +82,3 @@ func truthy(v string) bool {
return false return false
} }
} }

View File

@@ -6,16 +6,15 @@ import (
) )
type AuditEvent struct { type AuditEvent struct {
UserID string UserID string
Action string Action string
ResourceType string ResourceType string
ResourceID string ResourceID string
MetadataJSON json.RawMessage MetadataJSON json.RawMessage
IP string IP string
UserAgent string UserAgent string
} }
type AuditService interface { type AuditService interface {
Record(ctx context.Context, event AuditEvent) error Record(ctx context.Context, event AuditEvent) error
} }