Documentation
¶
Overview ¶
Package godis is a memory database with redis compatible interface
Index ¶
- func Auth(db *DB, c redis.Connection, args [][]byte) redis.Reply
- func BGRewriteAOF(db *DB, args [][]byte) redis.Reply
- func Decr(db *DB, args [][]byte) redis.Reply
- func DecrBy(db *DB, args [][]byte) redis.Reply
- func Del(db *DB, args [][]byte) redis.Reply
- func EntityToCmd(key string, entity *DataEntity) *reply.MultiBulkReply
- func Exists(db *DB, args [][]byte) redis.Reply
- func Expire(db *DB, args [][]byte) redis.Reply
- func ExpireAt(db *DB, args [][]byte) redis.Reply
- func FlushAll(db *DB, args [][]byte) redis.Reply
- func FlushDB(db *DB, args [][]byte) redis.Reply
- func GeoAdd(db *DB, args [][]byte) redis.Reply
- func GeoDist(db *DB, args [][]byte) redis.Reply
- func GeoHash(db *DB, args [][]byte) redis.Reply
- func GeoPos(db *DB, args [][]byte) redis.Reply
- func GeoRadius(db *DB, args [][]byte) redis.Reply
- func GeoRadiusByMember(db *DB, args [][]byte) redis.Reply
- func Get(db *DB, args [][]byte) redis.Reply
- func GetSet(db *DB, args [][]byte) redis.Reply
- func HDel(db *DB, args [][]byte) redis.Reply
- func HExists(db *DB, args [][]byte) redis.Reply
- func HGet(db *DB, args [][]byte) redis.Reply
- func HGetAll(db *DB, args [][]byte) redis.Reply
- func HIncrBy(db *DB, args [][]byte) redis.Reply
- func HIncrByFloat(db *DB, args [][]byte) redis.Reply
- func HKeys(db *DB, args [][]byte) redis.Reply
- func HLen(db *DB, args [][]byte) redis.Reply
- func HMGet(db *DB, args [][]byte) redis.Reply
- func HMSet(db *DB, args [][]byte) redis.Reply
- func HSet(db *DB, args [][]byte) redis.Reply
- func HSetNX(db *DB, args [][]byte) redis.Reply
- func HVals(db *DB, args [][]byte) redis.Reply
- func Incr(db *DB, args [][]byte) redis.Reply
- func IncrBy(db *DB, args [][]byte) redis.Reply
- func IncrByFloat(db *DB, args [][]byte) redis.Reply
- func Keys(db *DB, args [][]byte) redis.Reply
- func LIndex(db *DB, args [][]byte) redis.Reply
- func LLen(db *DB, args [][]byte) redis.Reply
- func LPop(db *DB, args [][]byte) redis.Reply
- func LPush(db *DB, args [][]byte) redis.Reply
- func LPushX(db *DB, args [][]byte) redis.Reply
- func LRange(db *DB, args [][]byte) redis.Reply
- func LRem(db *DB, args [][]byte) redis.Reply
- func LSet(db *DB, args [][]byte) redis.Reply
- func MGet(db *DB, args [][]byte) redis.Reply
- func MSet(db *DB, args [][]byte) redis.Reply
- func MSetNX(db *DB, args [][]byte) redis.Reply
- func PExpire(db *DB, args [][]byte) redis.Reply
- func PExpireAt(db *DB, args [][]byte) redis.Reply
- func PSetEX(db *DB, args [][]byte) redis.Reply
- func PTTL(db *DB, args [][]byte) redis.Reply
- func Persist(db *DB, args [][]byte) redis.Reply
- func Ping(db *DB, args [][]byte) redis.Reply
- func RPop(db *DB, args [][]byte) redis.Reply
- func RPopLPush(db *DB, args [][]byte) redis.Reply
- func RPush(db *DB, args [][]byte) redis.Reply
- func RPushX(db *DB, args [][]byte) redis.Reply
- func Rename(db *DB, args [][]byte) redis.Reply
- func RenameNx(db *DB, args [][]byte) redis.Reply
- func SAdd(db *DB, args [][]byte) redis.Reply
- func SCard(db *DB, args [][]byte) redis.Reply
- func SDiff(db *DB, args [][]byte) redis.Reply
- func SDiffStore(db *DB, args [][]byte) redis.Reply
- func SInter(db *DB, args [][]byte) redis.Reply
- func SInterStore(db *DB, args [][]byte) redis.Reply
- func SIsMember(db *DB, args [][]byte) redis.Reply
- func SMembers(db *DB, args [][]byte) redis.Reply
- func SRandMember(db *DB, args [][]byte) redis.Reply
- func SRem(db *DB, args [][]byte) redis.Reply
- func SUnion(db *DB, args [][]byte) redis.Reply
- func SUnionStore(db *DB, args [][]byte) redis.Reply
- func Set(db *DB, args [][]byte) redis.Reply
- func SetEX(db *DB, args [][]byte) redis.Reply
- func SetNX(db *DB, args [][]byte) redis.Reply
- func TTL(db *DB, args [][]byte) redis.Reply
- func Type(db *DB, args [][]byte) redis.Reply
- func ZAdd(db *DB, args [][]byte) redis.Reply
- func ZCard(db *DB, args [][]byte) redis.Reply
- func ZCount(db *DB, args [][]byte) redis.Reply
- func ZIncrBy(db *DB, args [][]byte) redis.Reply
- func ZRange(db *DB, args [][]byte) redis.Reply
- func ZRangeByScore(db *DB, args [][]byte) redis.Reply
- func ZRank(db *DB, args [][]byte) redis.Reply
- func ZRem(db *DB, args [][]byte) redis.Reply
- func ZRemRangeByRank(db *DB, args [][]byte) redis.Reply
- func ZRemRangeByScore(db *DB, args [][]byte) redis.Reply
- func ZRevRange(db *DB, args [][]byte) redis.Reply
- func ZRevRangeByScore(db *DB, args [][]byte) redis.Reply
- func ZRevRank(db *DB, args [][]byte) redis.Reply
- func ZScore(db *DB, args [][]byte) redis.Reply
- type DB
- func (db *DB) AddAof(args *reply.MultiBulkReply)
- func (db *DB) AfterClientClose(c redis.Connection)
- func (db *DB) Close()
- func (db *DB) Exec(c redis.Connection, cmdArgs [][]byte) (result redis.Reply)
- func (db *DB) Expire(key string, expireTime time.Time)
- func (db *DB) Flush()
- func (db *DB) GetEntity(key string) (*DataEntity, bool)
- func (db *DB) IsExpired(key string) bool
- func (db *DB) Lock(key string)
- func (db *DB) Locks(keys ...string)
- func (db *DB) Persist(key string)
- func (db *DB) PutEntity(key string, entity *DataEntity) int
- func (db *DB) PutIfAbsent(key string, entity *DataEntity) int
- func (db *DB) PutIfExists(key string, entity *DataEntity) int
- func (db *DB) RLock(key string)
- func (db *DB) RLocks(keys ...string)
- func (db *DB) RUnLock(key string)
- func (db *DB) RUnLocks(keys ...string)
- func (db *DB) Remove(key string)
- func (db *DB) Removes(keys ...string) (deleted int)
- func (db *DB) UnLock(key string)
- func (db *DB) UnLocks(keys ...string)
- type DataEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BGRewriteAOF ¶
BGRewriteAOF asynchronously rewrites Append-Only-File
func EntityToCmd ¶
func EntityToCmd(key string, entity *DataEntity) *reply.MultiBulkReply
EntityToCmd serialize data entity to redis command
func GeoRadiusByMember ¶
GeoRadiusByMember returns members within max distance of given member's location
func HIncrByFloat ¶
HIncrByFloat increments the float value of a hash field by the given number
func IncrByFloat ¶
IncrByFloat increments the float value of a key by given value
func SDiffStore ¶
SDiffStore subtracts multiple sets and store the result in a key
func SInterStore ¶
SInterStore intersects multiple sets and store the result in a key
func SRandMember ¶
SRandMember gets random members from set
func SUnionStore ¶
SUnionStore adds multiple sets and store the result in a key
func ZRangeByScore ¶
ZRangeByScore gets members which score within given range, in ascending order
func ZRemRangeByRank ¶
ZRemRangeByRank removes members within given indexes
func ZRemRangeByScore ¶
ZRemRangeByScore removes members which score within given range
func ZRevRangeByScore ¶
ZRevRangeByScore gets number of members which score within given range, in descending order
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB stores data and execute user's commands
func (*DB) AddAof ¶
func (db *DB) AddAof(args *reply.MultiBulkReply)
AddAof send command to aof goroutine through channel
func (*DB) AfterClientClose ¶
func (db *DB) AfterClientClose(c redis.Connection)
AfterClientClose does some clean after client close connection
func (*DB) Exec ¶
Exec executes command parameter `cmdArgs` contains command and its arguments, for example: "set key value"
func (*DB) GetEntity ¶
func (db *DB) GetEntity(key string) (*DataEntity, bool)
GetEntity returns DataEntity bind to given key
func (*DB) PutEntity ¶
func (db *DB) PutEntity(key string, entity *DataEntity) int
PutEntity a DataEntity into DB
func (*DB) PutIfAbsent ¶
func (db *DB) PutIfAbsent(key string, entity *DataEntity) int
PutIfAbsent insert an DataEntity only if the key not exists
func (*DB) PutIfExists ¶
func (db *DB) PutIfExists(key string, entity *DataEntity) int
PutIfExists edit an existing DataEntity
type DataEntity ¶
type DataEntity struct {
Data interface{}
}
DataEntity stores data bound to a key, including a string, list, hash, set and so on
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cluster provides a server side cluster which is transparent to client.
|
Package cluster provides a server side cluster which is transparent to client. |
|
datastruct
|
|
|
interface
|
|
|
lib
|
|
|
redis
|
|