mdb

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 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 struct {
	Addr     string             `json:"addr" yaml:"addr"`
	User     string             `json:"user" yaml:"user"`
	Password string             `json:"password" yaml:"password"`
	Database string             `json:"database" yaml:"database"`
	Provider string             `json:"provider" yaml:"provider"`
	Logger   *zap.SugaredLogger `json:"-" yaml:"-"`
}

func (*Config) Uri

func (c *Config) Uri() string

type MongoDB

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

func NewClient

func NewClient(ctx context.Context, lg *zap.SugaredLogger, c *Config) (*MongoDB, error)

func (*MongoDB) GetCollection

func (m *MongoDB) GetCollection(name string, opts ...*options.CollectionOptions) *mongo.Collection

func (*MongoDB) Shutdown

func (m *MongoDB) Shutdown(ctx context.Context)

Jump to

Keyboard shortcuts

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