mongo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = Configuration{
	Dbs: make(map[string]DbConfig),
}

Functions

func Database

func Database(dbName string) *mgo.Database

func DatabaseC

func DatabaseC(dbName, collectionName string) *mgo.Collection

func Ping

func Ping()

func SetAutoPing

func SetAutoPing(interv time.Duration)

Types

type Configuration

type Configuration struct {
	Dbs map[string]DbConfig
}

func (*Configuration) Close

func (c *Configuration) Close() error

func (*Configuration) Init

func (c *Configuration) Init() error

func (*Configuration) Name

func (c *Configuration) Name() string

type DbConfig

type DbConfig struct {
	Host     string
	Database string
	User     string
	Password string
	Safe     mgo.Safe
}

Jump to

Keyboard shortcuts

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