helpers

package
v0.0.0-...-c14cf11 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalWorker interface{}

Functions

func AnyTypeInt

func AnyTypeInt(sint interface{}) (ret int)

func BitCount

func BitCount(i uint64) int

计算64位int中1的位数

func Crc16

func Crc16(bs []byte) (crc uint16)

func EtcdDail

func EtcdDail(etcdconfig toml.DBConfig) *clientv3.Client

func GenDayIncrId

func GenDayIncrId(filed string) int

func GenIncrId

func GenIncrId(filed string) int

func GenInnerIncrId

func GenInnerIncrId() int

func LoadFile

func LoadFile(filename string) (filedata string, err error)

func MongoDail

func MongoDail(mongoconfig toml.DBConfig) *mgo.Session

func MysqlDail

func MysqlDail(mysqlconfig toml.DBConfig) *xorm.Engine

func MysqlDailName

func MysqlDailName(mysqlconfig toml.DBConfig, dbName string) *xorm.Engine

func Pack

func Pack(v interface{}) (string, error)

func RedisDail

func RedisDail(redisconfig toml.DBConfig) redis.Conn

func UnPack

func UnPack(data []byte, v interface{}) error

Types

type Redis

type Redis struct {
	Conn   redis.Conn
	Config toml.DBConfig
	Pool   *redis.Pool
}
var GlobalRedis *Redis

func InstanceRedis

func InstanceRedis(config toml.DBConfig) *Redis

func (*Redis) Dail

func (this *Redis) Dail() redis.Conn

func (*Redis) HGet

func (this *Redis) HGet(key string, field interface{}) (string, error)

func (*Redis) HGetOrgin

func (this *Redis) HGetOrgin(key string, field interface{}) (interface{}, error)

func (*Redis) HIncrBy

func (this *Redis) HIncrBy(key string, field string, by int) (int64, error)

func (*Redis) HSet

func (this *Redis) HSet(key string, field interface{}, value interface{}) error

func (*Redis) NewPool

func (this *Redis) NewPool() *redis.Pool

Jump to

Keyboard shortcuts

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