dao

package
v0.0.0-...-bff975f Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mysql

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

func NewMysql

func NewMysql(userName, password, ipHost, dbName string) (d *Mysql)

func (*Mysql) Close

func (d *Mysql) Close()

func (*Mysql) GetCacheData

func (d *Mysql) GetCacheData() map[string]int

func (*Mysql) GetSonoData

func (d *Mysql) GetSonoData(name string) []*model.BookInfo

type Redis

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

func NewRedis

func NewRedis(addr, passord string) (r *Redis)

func (*Redis) Close

func (f *Redis) Close()

func (*Redis) Get

func (f *Redis) Get(key string) (string, error)

func (*Redis) GetAllHashTable

func (f *Redis) GetAllHashTable(key string) (map[string]string, error)

主要用这个,一次从redis中读出一个id对一个的所有hashTable。但是在key对应的数据量比较大的情况下,非常不推荐使用HGetAll

func (*Redis) GetHashTable

func (f *Redis) GetHashTable(key string, field string) (string, error)

func (*Redis) Set

func (f *Redis) Set(key string, value string) error

func (*Redis) SetHashTable

func (f *Redis) SetHashTable(key string, hashTable map[string]interface{})

Jump to

Keyboard shortcuts

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