mongo

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conn *DBConn) (*mongo.Client, error)

New creates a new MongoDB client

Types

type DBConn

type DBConn struct {
	Hosts           []string          `json:"hosts" yaml:"hosts"`
	Username        string            `json:"username" yaml:"username"`
	Password        string            `json:"password" yaml:"password"`
	AuthDB          string            `json:"authDB" yaml:"authDB"`
	MaxPoolSize     uint64            `json:"maxPoolSize" yaml:"maxPoolSize"`
	MinPoolSize     uint64            `json:"minPoolSize" yaml:"minPoolSize"`
	MaxConnIdleTime time.Duration     `json:"maxConnIdleTime" yaml:"maxConnIdleTime"`
	ConnectTimeout  time.Duration     `json:"connectTimeout" yaml:"connectTimeout"`
	Options         map[string]string `json:"options" yaml:"options"`
}

DBConn MongoDB connection config

Jump to

Keyboard shortcuts

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