datasource

package
v0.0.0-...-ad2cf94 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(where map[string]interface{}) *xorm.Session

Filter 将map[string]interface{} 分解成表字段和值 进行拼接查询

func FilterWhereAnd

func FilterWhereAnd(db *xorm.Engine, i int, key string, value ...interface{})

FilterWhereAnd 判断是否启用事务操作

func GetConnURL

func GetConnURL(mors string) (url string)

GetConnURL 获取数据库连接的url true:master主库

func MasterEngine

func MasterEngine() *xorm.Engine

func SlaveEngine

func SlaveEngine() *xorm.Engine

SlaveEngine 从库,单例

Types

type QuerySession

type QuerySession struct {
	Session *xorm.Session
}

QuerySession 事务操作

var Query *QuerySession

type RedisConn

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

RedisConn 封装成一个redis资源池 连接池

func InstanceCache

func InstanceCache() *RedisConn

InstanceCache 得到唯一的redis缓存实例

func NewCache

func NewCache() *RedisConn

NewCache 重新实例化

func (*RedisConn) Do

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

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

func (*RedisConn) ShowDebug

func (rds *RedisConn) ShowDebug(b bool)

ShowDebug 设置是否打印操作日志 前面用到名字是小写的这里要大写实例它

Jump to

Keyboard shortcuts

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