mongo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	*driver.Client
	// contains filtered or unexported fields
}

func NewMongo

func NewMongo(ctx context.Context, uri string, opts ...*options.ClientOptions) (*Mongo, error)

NewMongo returns new instance of Mongo as driver wither use go.mongodb.org/mongo-driver/mongo

ctx - use ctx from engine function GetCTX() opts is ClientOptions from go.mongodb.org/mongo-driver/mongo/options

func (*Mongo) ChangeInstanceName

func (m *Mongo) ChangeInstanceName(name string)

ChangeInstanceName use this method if you want change closer and checker name

func (*Mongo) Closer

func (m *Mongo) Closer() engine.Closer

Closer use for registration mongo closer in wither engine

this func allocate new closer for mongo USE IT ONLY ONE TIME

func (*Mongo) GetName

func (m *Mongo) GetName() string

func (*Mongo) HealthChecker

func (m *Mongo) HealthChecker(timeout time.Duration) engine.Checker

HealthChecker use for registration mongo health check in wither engine timeout is duration for ping (use context.WithTimeout inside)

Jump to

Keyboard shortcuts

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