Refactor app structure: move models to domain, centralize config and database init - TODO: add jwt

This commit is contained in:
2025-05-17 20:07:29 +03:30
parent ab9254fcad
commit 7b601e75ba
12 changed files with 142 additions and 181 deletions

View File

@@ -19,7 +19,9 @@ type config struct {
Tag string
}
func SetupAppContext() *config {
var Config *config
func Load() *config {
// Get mastodon instance
instance := os.Getenv("CAOM_INSTANCE")
if instance == "" {
@@ -77,3 +79,7 @@ func SetupAppContext() *config {
return appContext
}
func Init() {
Config = Load()
}