mongoatlas

package
v0.0.0-...-1cb9ecb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 6 Imported by: 0

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

type MongoClient struct {
	*mongo.Client
	// contains filtered or unexported fields
}

func NewMongoClient

func NewMongoClient(cfg Config) (*MongoClient, error)

func (*MongoClient) CreateCollection

func (m *MongoClient) CreateCollection(name string) *mongo.Collection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL