mongo

package
v0.0.0-...-2ef827d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	User     string
	Password string
}

type Wrapper

type Wrapper interface {
	database.Client
	Client() *mongo.Client
}

func New

func New(configKey string) Wrapper

New instantiates a new client wrapper. A call to Initialize is required before use. The configKey parameter dictates which key in the configuration file will be read during initialization. If configKey is empty, the default value of "mongo.url" will be used. The configuration can be in various formats, but the following is an example of a yaml file:

mongo:
  url: mongodb://user:password@localhost:27017

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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