db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxIdle of mysql connection
	MaxIdle = 10
	// MaxOpen of mysql connection
	MaxOpen = 20
)

Functions

func NewRedisClient

func NewRedisClient(redisInfo config.RedisInstance) *redis.Client

NewRedisClient get a redis client

Types

type MysqlManager

type MysqlManager struct {
	App    service.Application `inject:"app"`
	Config config.MysqlConfig
	// contains filtered or unexported fields
}

MysqlManager for mysql connection

func NewMysqlManager

func NewMysqlManager(app service.Application, config config.MysqlConfig) (*MysqlManager, error)

NewMysqlManager returns a new MysqlManager

func (*MysqlManager) DB

func (mm *MysqlManager) DB(name string) *xorm.Engine

DB gets databases by name

func (*MysqlManager) R

func (mm *MysqlManager) R() *xorm.Engine

R get read-only mysql Engine

func (*MysqlManager) W

func (mm *MysqlManager) W() *xorm.Engine

W gets master mysql Engine

Jump to

Keyboard shortcuts

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