Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
GetMongoAtlasEnv() *MongoAtlasEnv
}
type MongoAtlasEnv ¶
type MongoAtlasEnv struct { MongoAtlasURL string `env:"MONGOATLAS_URL"` MongoAtlasDb string `env:"MONGOATLAS_DB"` MongoAtlasConnTimeout time.Duration `env:"MONGOATLAS_CONN_TIMEOUT" envDefault:"10s"` CredentialsFile string `env:"MONGOATLAS_CREDENTIALS_FILE"` User string `env:"MONGOATLAS_USER" envDefault:""` Password string `env:"MONGOATLAS_PASSWORD" envDefault:""` }
MongodbEnv obtiene la configuracion desde el entorno
type MongoClient ¶
func NewMongoClient ¶
func NewMongoClient(cfg Config) (*MongoClient, error)
func (*MongoClient) CreateCollection ¶
func (m *MongoClient) CreateCollection(name string) *mongo.Collection
Click to show internal directories.
Click to hide internal directories.