Documentation ¶
Overview ¶
Package mongodb is a module for mongodb
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBContext ¶
type MongoDBContext interface { // GetConn returns the mongodb connection GetConn() *mongo.Client // GetDatabase returns the mongodb database GetDatabase() *mongo.Database // Close closes the mongodb connection Close() error // Ping pings the mongodb connection Ping() error }
func NewMongoDB ¶
func NewMongoDB(opts ...Option) (MongoDBContext, error)
NewMongoDB creates a new mongodb connection
type MongoDBOptions ¶
MongoDBOptions defines the mongo configuration
type Option ¶
type Option func(*MongoDBOptions)
Option is the func interface to assign options
func WithMongoDBDatabase ¶
WithMongoDBDatabase defines the Mongo Connection Database
func WithMongoDBPassword ¶
WithMongoDBPassword defines the Mongo Connection password
func WithMongoDBURI ¶
WithMongoDBURI defines the Mongo Connection URI
func WithMongoDBUsername ¶
WithMongoDBUsername defines the Mongo Connection Username
Click to show internal directories.
Click to hide internal directories.