✨ improve the functions related to commenting on images
This commit is contained in:
18
config/conf_mongodb.go
Normal file
18
config/conf_mongodb.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package config
|
||||
|
||||
import "strconv"
|
||||
|
||||
type MongoDB struct {
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
AuthSource string `yaml:"auth-source"`
|
||||
DB string `yaml:"db"`
|
||||
User string `yaml:"user"`
|
||||
Password string `yaml:"password"`
|
||||
MaxOpenConn int `yaml:"max-open-conn"`
|
||||
MaxIdleConn int `yaml:"max-idle-conn"`
|
||||
}
|
||||
|
||||
func (m *MongoDB) MongoDsn() string {
|
||||
return "mongodb://" + m.Host + ":" + strconv.Itoa(m.Port)
|
||||
}
|
@@ -12,4 +12,5 @@ type Config struct {
|
||||
OAuth OAuth `yaml:"oauth"`
|
||||
Swagger Swagger `yaml:"swagger"`
|
||||
Casbin Casbin `yaml:"casbin"`
|
||||
MongoDB MongoDB `yaml:"mongodb"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user