This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Files
schisandra-cloud-album/config/conf_mongodb.go
2024-09-23 00:53:43 +08:00

19 lines
457 B
Go

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)
}