mongo

package
v0.9.1-0...-40a840d Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mongo provides a simple wrapper around 3rd party mongo client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	C *mongo.Client
}

Client is a wrapper around the mongo client

func NewClient

func NewClient(opts Options) (*Client, error)

NewClient creates a new mongo client

func (*Client) DeleteDatabases

func (c *Client) DeleteDatabases() error

DeleteDatabases deletes all databases except the default ones

func (*Client) Stop

func (c *Client) Stop() error

Stop stops the mongo client

type Options

type Options struct {
	ClientDialer     *net.Dialer
	ServerAddress    string
	Username         string
	Password         string
	ConnectionTimout time.Duration
}

Options is a struct to hold the options for the mongo client

Jump to

Keyboard shortcuts

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