Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Clienter ¶
type Clienter interface {
Connect(opts ...*options.ClientOptions) (*mongo.Client, error)
Disconnect(ctx context.Context) error
Ping(ctx context.Context, rp *readpref.ReadPref) error
StartSession(opts ...options.Lister[options.SessionOptions]) (*mongo.Session, error)
Database(name string, opts ...options.Lister[options.DatabaseOptions]) *mongo.Database
ListDatabases(
ctx context.Context,
filter any,
opts ...options.Lister[options.ListDatabasesOptions],
) (mongo.ListDatabasesResult, error)
}
Clienter interface.
type Config ¶
type Config struct {
DSN string `env:"DSN,default=mongodb://localhost:27017/database?retryWrites=false" json:"dsn"`
Username string `env:"USERNAME,default=username" json:"username"`
Password string `env:"PASSWORD,default=password" json:"password"`
}
Config database configuration loader.
Click to show internal directories.
Click to hide internal directories.