dbconn

package
v0.0.0-...-cce48a0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeIndex

func MakeIndex(unique bool, keys interface{}) mongo.IndexModel

func MakeIndexWithExpiry

func MakeIndexWithExpiry(ttl int, unique bool, keys interface{}) mongo.IndexModel

Types

type Conn

type Conn interface {
	Backend() interface{}
	DatabaseName() string
	TestConn(ctx context.Context) error
	Close() error
}

func NewMongoConn

func NewMongoConn(ctx context.Context, cfg *MongoConfig) (Conn, error)

NewMongoConn creates a new MongoDB connection and initialzied client.

type MongoConfig

type MongoConfig struct {
	AppName    string
	Connection string
	Database   string
	Debug      bool
}

Jump to

Keyboard shortcuts

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