mongo

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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