config pb

This commit is contained in:
mr 2024-07-18 16:14:39 +02:00
parent e3a7703bc5
commit 8eb88dcd82

12
conf.go
View File

@ -9,16 +9,16 @@ import "sync"
// =================================================== // ===================================================
type Config struct { type Config struct {
mongoUrl string MongoUrl string
mongoDatabase string MongoDatabase string
} }
func (c Config) GetUrl() string { func (c Config) GetUrl() string {
return c.mongoUrl return c.MongoUrl
} }
func (c Config) GetDatabase() string { func (c Config) GetDatabase() string {
return c.mongoDatabase return c.MongoDatabase
} }
var instance *Config var instance *Config
@ -33,8 +33,8 @@ func GetConfig() *Config {
func SetConfig(url string, database string) *Config { func SetConfig(url string, database string) *Config {
instance = &Config{ instance = &Config{
mongoUrl: url, MongoUrl: url,
mongoDatabase: database, MongoDatabase: database,
} }
return instance return instance
} }