mongo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = mgo.ErrNotFound
)

Functions

This section is empty.

Types

type Config

type Config struct {
	mgo.DialInfo
}

func DefaultConfig

func DefaultConfig(addrs []string) *Config

type Interface

type Interface interface {
	// Open 启动Mongo Driver
	Open(conf *Config) error

	// Close 关闭MongoDriver
	Close() error

	// GetSession 获取一个session, 这里的GetSession采用的是Copy的方式
	GetSession() *mgo.Session

	// PutSession 释放一个session
	PutSession(s *mgo.Session)
}

func New

func New() Interface

Jump to

Keyboard shortcuts

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