refactor(config): move Config struct from business layer to platform/config
Moved the Config struct (previously in internal/models/config.go) into internal/platform/config/types.go to align with clean architecture principles. This change decouples runtime/infrastructure configuration from domain models: - Configuration is an application/platform concern, not part of the business domain. - Prevents potential circular imports between models and platform packages. - Simplifies future integration with platform components (SCS sessions, CSRF, DB). No functional changes to configuration loading structure and JSON schema remain the same; only the package location and imports were updated.
This commit is contained in:
40
internal/platform/config/types.go
Normal file
40
internal/platform/config/types.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package config
|
||||
|
||||
type Config struct {
|
||||
CSRF struct {
|
||||
CSRFKey string `json:"csrfKey"`
|
||||
} `json:"csrf"`
|
||||
|
||||
Database struct {
|
||||
Server string `json:"server"`
|
||||
Port int `json:"port"`
|
||||
DatabaseNamed string `json:"databaseName"`
|
||||
MaxOpenConnections int `json:"maxOpenConnections"`
|
||||
MaxIdleConnections int `json:"maxIdleConnections"`
|
||||
ConnectionMaxLifetime string `json:"connectionMaxLifetime"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
HttpServer struct {
|
||||
Port int `json:"port"`
|
||||
Address string `json:"address"`
|
||||
ProductionMode bool `json:"productionMode"`
|
||||
} `json:"httpServer"`
|
||||
|
||||
License struct {
|
||||
APIURL string `json:"apiUrl"`
|
||||
APIKey string `json:"apiKey"`
|
||||
} `json:"license"`
|
||||
|
||||
Session struct {
|
||||
AuthKeyPath string `json:"authKeyPath"`
|
||||
EncryptionKeyPath string `json:"encryptionKeyPath"`
|
||||
Name string `json:"name"`
|
||||
} `json:"session"`
|
||||
|
||||
Site struct {
|
||||
SiteName string `json:"siteName"`
|
||||
CopyrightYearStart int `json:"copyrightYearStart"`
|
||||
} `json:"site"`
|
||||
}
|
||||
Reference in New Issue
Block a user