redis

package module
v0.0.0-...-53e2c75 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	*redis.Client
	DaoStruct     string
	DaoStructType reflect.Type
	DbNnum        int
	DataKey       string
}

func NewDao

func NewDao() *Dao

func (*Dao) GetConfig

func (dao *Dao) GetConfig() *redis.Options

GetConfig : return redis.Options

func (*Dao) OpenDB

func (dao *Dao) OpenDB() *Dao

OpenDB : connect to db

func (*Dao) OpenDBWithPoolConns

func (dao *Dao) OpenDBWithPoolConns(active, idle int) *Dao

OpenDBWithPoolConns : connect to db and set pool conns

func (*Dao) SetConfig

func (dao *Dao) SetConfig(addr, pw string, db int) *Dao

SetConfig : set config by user, pw, addr, db

func (*Dao) SetDefaultModel

func (dao *Dao) SetDefaultModel(tb interface{}, deftultDataKey string) (err error)

SetDefaultModel : register a table struct for this dao

func (*Dao) SetOriginConfig

func (dao *Dao) SetOriginConfig(c *redis.Options) *Dao

SetOriginConfig : set config by redis.Options

Jump to

Keyboard shortcuts

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