Documentation
¶
Index ¶
- type Config
- type Database
- func (d *Database) BuildInfo() (bson.M, error)
- func (d *Database) Close() error
- func (d *Database) Database(dbName ...string) *mongo.Database
- func (d *Database) DbStats(dbname string) (bson.M, error)
- func (d *Database) HostInfo() (bson.M, error)
- func (d *Database) ListDatabase() (mongo.ListDatabasesResult, error)
- func (d *Database) ListDatabaseNames() ([]string, error)
- func (d *Database) Open() error
- func (d *Database) Ping() error
- func (d *Database) SelectDatabase(dbName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
User string `json:"user" yaml:"user"`
Password string `json:"password" yaml:"password"`
Auth string `json:"auth" yaml:"auth"`
DBName string `json:"db_name" yaml:"db_name"`
PoolSize uint64 `json:"pool_size" yaml:"pool_size"`
Timeout uint64 `json:"timeout" yaml:"timeout"`
Compression bool `json:"compression" yaml:"compression"`
}
dsn mongodb://root:WiaQ82n7B3L5Cz*2#10m@172.18.76.150:27017?authSource=admin
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
mongodb orm use official driver
func NewDatabase ¶
func NewDatabaseDsn ¶ added in v1.6.6
func (*Database) ListDatabase ¶
func (d *Database) ListDatabase() (mongo.ListDatabasesResult, error)
func (*Database) ListDatabaseNames ¶
Click to show internal directories.
Click to hide internal directories.