style: align struct fields in config, domain, and auth
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user