22 lines
347 B
Go
22 lines
347 B
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"reichard.io/imagini/internal/db"
|
||
|
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
type ServerConfig struct {
|
||
|
db *gorm.DB
|
||
|
settings *Settings
|
||
|
}
|
||
|
|
||
|
func NewConfig() {
|
||
|
loadedSettings := loadSettings()
|
||
|
loadedDB := db.OpenDB(&loadedSettings)
|
||
|
newConfig := &Config {
|
||
|
settings: &loadedSettings,
|
||
|
db: &loadedDB,
|
||
|
}
|
||
|
}
|