db

package
v0.0.0-...-a2fbdec Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MongoCopyType  = "1"
	MongoCloneType = "2"
)

Variables

View Source
var (
	DBNAME = config.Conf.DB.DBName
)

Functions

func GetDBSession

func GetDBSession() (*mgo.Session, error)

GetSession get the db session

func GetRedisPool

func GetRedisPool() *redis.Pool

GetRedisPool get the client pool of redis

Types

type MgoDBCntlr

type MgoDBCntlr struct {
	// contains filtered or unexported fields
}

mgo controller

func NewCloneMgoDBCntlr

func NewCloneMgoDBCntlr() *MgoDBCntlr

func NewCopyMgoDBCntlr

func NewCopyMgoDBCntlr() *MgoDBCntlr

func (*MgoDBCntlr) Close

func (this *MgoDBCntlr) Close()

func (*MgoDBCntlr) GetDB

func (this *MgoDBCntlr) GetDB() *mgo.Database

func (*MgoDBCntlr) GetTable

func (this *MgoDBCntlr) GetTable(tableName string) *mgo.Collection

type RedisDBCntlr

type RedisDBCntlr struct {
	// contains filtered or unexported fields
}

redis controller

func NewRedisDBCntlr

func NewRedisDBCntlr() *RedisDBCntlr

func (*RedisDBCntlr) Close

func (this *RedisDBCntlr) Close()

func (*RedisDBCntlr) GetConn

func (this *RedisDBCntlr) GetConn() redis.Conn

func (*RedisDBCntlr) Send

func (this *RedisDBCntlr) Send(commandName string, args ...interface{}) error

Jump to

Keyboard shortcuts

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