mongodbclient

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package mongodbclient creates a mongodb client.

Index

Constants

View Source
const DefaultTimeout = 10 * time.Second

DefaultTimeout is used when Options Timeout isn't specified.

Variables

This section is empty.

Functions

func New

func New(opt Options) (*mongo.Client, error)

New creates a mongodb client.

Types

type Options

type Options struct {
	URI         string
	Username    string
	Password    string
	TLSCAFile   string
	Timeout     time.Duration // Defaults to 10 seconds
	MinPoolSize uint64
	Logf        func(format string, v ...any) // Defaults to log.Printf
	Debug       bool                          // Log debug messages
}

Options specifies parameters for mongodb client.

Jump to

Keyboard shortcuts

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