mongodb

package
v0.0.0-...-337c1d2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	MongoDB *mongo.Client
}

Client wraps a MongoDB client with additional functionality.

func NewClient

func NewClient(ctx context.Context, cfg *config.Config) (*Client, error)

NewClient establishes a new connection to MongoDB using the provided configuration. It first tries to connect with the current password, and upon failure, retries with the new password.

func (*Client) Disconnect

func (c *Client) Disconnect(ctx context.Context) error

Disconnect terminates the connection to the MongoDB database.

func (*Client) UpdatePassword

func (c *Client) UpdatePassword(ctx context.Context, cfg *config.Config) error

UpdatePassword changes the MongoDB user's password based on configuration settings.

Jump to

Keyboard shortcuts

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