config pb
This commit is contained in:
parent
e3a7703bc5
commit
8eb88dcd82
12
conf.go
12
conf.go
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user