move config

This commit is contained in:
ycc
2024-07-11 15:40:34 +02:00
parent 32fcbb7ffe
commit 6b34be6508
3 changed files with 7 additions and 6 deletions

View File

@@ -1,19 +0,0 @@
package models
import "sync"
type Config struct {
MongoUrl string
MongoLogin string
MongoPassword string
}
var instance *Config
var once sync.Once
func GetConfig() *Config {
once.Do(func() {
instance = &Config{}
})
return instance
}

View File

@@ -2,10 +2,11 @@ package models
import (
"fmt"
"oc-workflow/conf"
)
func init() {
c := GetConfig()
c := conf.GetConfig()
// configure storage
fmt.Println(c.MongoUrl)
}