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-24 21:37:37 +08:00

20 lines
494 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 uint64 `yaml:"max-open-conn"`
MaxIdleConn uint64 `yaml:"max-idle-conn"`
Timeout int `yaml:"timeout"`
}
func (m *MongoDB) MongoDsn() string {
return "mongodb://" + m.Host + ":" + strconv.Itoa(m.Port)
}