mongo

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConnected = fmt.Errorf("is not connected to db yet, call Connect() method")

Functions

func ConnectAndPing

func ConnectAndPing(ctx context.Context, authenticatedUri string) error

func FailsWithAuthError

func FailsWithAuthError(err error) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, uri string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, dbName string, username string) error

func (*Client) Ping added in v1.0.1

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

func (*Client) UpdateUserPassword

func (c *Client) UpdateUserPassword(ctx context.Context, dbName string, userName string, password string) error

func (*Client) UpsertUser

func (c *Client) UpsertUser(ctx context.Context, dbName string, userName string, password string) error

func (*Client) UserExists

func (c *Client) UserExists(ctx context.Context, dbName string, userName string) (bool, error)

type ErrUserExists

type ErrUserExists struct {
	Message string `json:"message"`
}

func (ErrUserExists) Error

func (e ErrUserExists) Error() string

Jump to

Keyboard shortcuts

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