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 {
repo domain.AuthRepository
auditSvc domain.AuditService
repo domain.AuthRepository
auditSvc domain.AuditService
}
func NewAuthService(repo domain.AuthRepository, auditSvc domain.AuditService) domain.AuthService {

View File

@@ -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
}
}

View File

@@ -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
}