mongodb

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToStructure

func MapToStructure(in map[string]interface{}, out interface{}) error

func StructureToMap

func StructureToMap(obj interface{}) (map[string]interface{}, error)

Types

type Client

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

func New

func New(connString string, databaseName string, opts ...ClientOpt) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) ContextWithTimeout

func (c *Client) ContextWithTimeout() (context.Context, context.CancelFunc)

func (*Client) Database

func (c *Client) Database() *mongo.Database

type ClientOpt

type ClientOpt func(opts *clientOpts)

func WithReadPref added in v1.5.0

func WithReadPref(pref *readpref.ReadPref) ClientOpt

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOpt

func WithTraceProvider

func WithTraceProvider(traceProvider trace.TracerProvider) ClientOpt

Jump to

Keyboard shortcuts

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