mongodb

package
v0.0.0-...-5515e0f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Types

type Config

type Config struct {
	URI               string `yaml:"uri"`
	Timeout           int    `yaml:"timeout"`
	MaxPoolSize       int    `yaml:"maxPoolSize"`
	MaxConnIdleTime   int    `yaml:"maxConnIdleTime"`
	HeartBeatInterval int    `yaml:"heartBeatInterval"`
	Database          string `yaml:"database"`
}

func NewConfig

func NewConfig(s *setting.Setting) (*Config, error)

type MongoDB

type MongoDB struct {
	module.DefaultProvider
	Config *Config

	Client   *mongo.Client
	Database *mongo.Database
	// contains filtered or unexported fields
}

func New

func New(config *Config, appProvider *app.App, probesProvider *probes.Probes) *MongoDB

func (*MongoDB) Close

func (p *MongoDB) Close() error

func (*MongoDB) Init

func (p *MongoDB) Init() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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