dbutil

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

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

Session is a plain-old-data struct that represents a handle to a MongoDB database.

func Connect

func Connect(
	ctx context.Context,
	logger *zap.Logger,
	uri string,
	databaseName string,
	enableQueryLog bool,
) (*Session, error)

Connect to a MongoDB database.

func (*Session) DisconnectWithTimeout

func (s *Session) DisconnectWithTimeout(timeout time.Duration) error

Disconnect from a MongoDB database.

Jump to

Keyboard shortcuts

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