Beego set up

This commit is contained in:
mr
2026-02-03 15:56:39 +01:00
parent 4f28b9b589
commit c90b55f312
2 changed files with 18 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import "sync"
// ===================================================
type Config struct {
APIPort int
NATSUrl string
MongoUrl string
MongoDatabase string
@@ -39,12 +40,13 @@ func GetConfig() *Config {
return instance
}
func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string, logLevel string) *Config {
func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string, logLevel string, port int) *Config {
GetConfig().MongoUrl = mongoUrl
GetConfig().MongoDatabase = database
GetConfig().NATSUrl = natsUrl
GetConfig().LokiUrl = lokiUrl
GetConfig().LogLevel = logLevel
GetConfig().Whitelist = true
GetConfig().APIPort = port
return GetConfig()
}