datasource

package
v0.0.0-...-dcc0b38 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstanceDbMaster

func InstanceDbMaster() *xorm.Engine

TODO - NOTICE 单例模式 - 得到唯一的主库实例

在应用运行期间会不断调用数据库操作,不能每次调用都实例化1次

func NewDbMaster

func NewDbMaster() *xorm.Engine

返回xorm的MySQL数据库操作引擎

Types

type RedisConn

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

封装成一个redis资源池

func InstanceCache

func InstanceCache() *RedisConn

单例模式 - 得到唯一的redis缓存实例

func NewCache

func NewCache() *RedisConn

RedisConn 实例化

func (*RedisConn) Do

func (rds *RedisConn) Do(commandName string, args ...interface{}) (reply interface{}, err error)

对外只有一个命令,封装了一个redis的命令

func (*RedisConn) ShowDebug

func (rds *RedisConn) ShowDebug(b bool)

设置是否打印操作日志

Jump to

Keyboard shortcuts

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