本文整理汇总了Golang中github.com/bsm/redeo.Server.HandleFunc方法的典型用法代码示例。如果您正苦于以下问题:Golang Server.HandleFunc方法的具体用法?Golang Server.HandleFunc怎么用?Golang Server.HandleFunc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/bsm/redeo.Server
的用法示例。
在下文中一共展示了Server.HandleFunc方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: commandsTransaction
// commandsTransaction handles MULTI &c.
func commandsTransaction(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("DISCARD", m.cmdDiscard)
srv.HandleFunc("EXEC", m.cmdExec)
srv.HandleFunc("MULTI", m.cmdMulti)
srv.HandleFunc("UNWATCH", m.cmdUnwatch)
srv.HandleFunc("WATCH", m.cmdWatch)
}
示例2: commandsConnection
func commandsConnection(m *Redico, srv *redeo.Server) {
srv.HandleFunc("AUTH", m.cmdAuth)
srv.HandleFunc("ECHO", m.cmdEcho)
srv.HandleFunc("PING", m.cmdPing)
srv.HandleFunc("SELECT", m.cmdSelect)
srv.HandleFunc("QUIT", m.cmdQuit)
}
示例3: commandsGeneric
func commandsGeneric(m *Redico, srv *redeo.Server) {
srv.HandleFunc("DEL", m.cmdDel)
// DUMP
srv.HandleFunc("EXISTS", m.cmdExists)
srv.HandleFunc("KEYS", m.cmdKeys)
srv.HandleFunc("KEYSSTART", m.cmdKeysStart)
srv.HandleFunc("KEYSRANGE", m.cmdKeyRange)
// OBJECT
srv.HandleFunc("SCAN", m.cmdScan)
}
示例4: commandsServer
func commandsServer(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("DBSIZE", m.cmdDbsize)
srv.HandleFunc("FLUSHALL", m.cmdFlushall)
srv.HandleFunc("FLUSHDB", m.cmdFlushdb)
}
示例5: commandsList
// commandsList handles list commands (mostly L*)
func commandsList(m *Miniredis, srv *redeo.Server) {
// BLPOP key [key ...] timeout
// BRPOP key [key ...] timeout
// BRPOPLPUSH source destination timeout
srv.HandleFunc("LINDEX", m.cmdLindex)
srv.HandleFunc("LINSERT", m.cmdLinsert)
srv.HandleFunc("LLEN", m.cmdLlen)
srv.HandleFunc("LPOP", m.cmdLpop)
srv.HandleFunc("LPUSH", m.cmdLpush)
srv.HandleFunc("LPUSHX", m.cmdLpushx)
srv.HandleFunc("LRANGE", m.cmdLrange)
srv.HandleFunc("LREM", m.cmdLrem)
srv.HandleFunc("LSET", m.cmdLset)
srv.HandleFunc("LTRIM", m.cmdLtrim)
srv.HandleFunc("RPOP", m.cmdRpop)
srv.HandleFunc("RPOPLPUSH", m.cmdRpoplpush)
srv.HandleFunc("RPUSH", m.cmdRpush)
srv.HandleFunc("RPUSHX", m.cmdRpushx)
}
示例6: commandsHash
// commandsHash handles all hash value operations.
func commandsHash(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("HDEL", m.cmdHdel)
srv.HandleFunc("HEXISTS", m.cmdHexists)
srv.HandleFunc("HGET", m.cmdHget)
srv.HandleFunc("HGETALL", m.cmdHgetall)
srv.HandleFunc("HINCRBY", m.cmdHincrby)
srv.HandleFunc("HINCRBYFLOAT", m.cmdHincrbyfloat)
srv.HandleFunc("HKEYS", m.cmdHkeys)
srv.HandleFunc("HLEN", m.cmdHlen)
srv.HandleFunc("HMGET", m.cmdHmget)
srv.HandleFunc("HMSET", m.cmdHmset)
srv.HandleFunc("HSET", m.cmdHset)
srv.HandleFunc("HSETNX", m.cmdHsetnx)
srv.HandleFunc("HVALS", m.cmdHvals)
srv.HandleFunc("HSCAN", m.cmdHscan)
}
示例7: commandsSet
// commandsSet handles all set value operations.
func commandsSet(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("SADD", m.cmdSadd)
srv.HandleFunc("SCARD", m.cmdScard)
srv.HandleFunc("SDIFF", m.cmdSdiff)
srv.HandleFunc("SDIFFSTORE", m.cmdSdiffstore)
srv.HandleFunc("SINTER", m.cmdSinter)
srv.HandleFunc("SINTERSTORE", m.cmdSinterstore)
srv.HandleFunc("SISMEMBER", m.cmdSismember)
srv.HandleFunc("SMEMBERS", m.cmdSmembers)
srv.HandleFunc("SMOVE", m.cmdSmove)
srv.HandleFunc("SPOP", m.cmdSpop)
srv.HandleFunc("SRANDMEMBER", m.cmdSrandmember)
srv.HandleFunc("SREM", m.cmdSrem)
srv.HandleFunc("SUNION", m.cmdSunion)
srv.HandleFunc("SUNIONSTORE", m.cmdSunionstore)
srv.HandleFunc("SSCAN", m.cmdSscan)
}
示例8: commandsGeneric
// commandsGeneric handles EXPIRE, TTL, PERSIST, &c.
func commandsGeneric(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("DEL", m.cmdDel)
// DUMP
srv.HandleFunc("EXISTS", m.cmdExists)
srv.HandleFunc("EXPIRE", makeCmdExpire(m, "expire"))
srv.HandleFunc("EXPIREAT", makeCmdExpire(m, "expireat"))
srv.HandleFunc("KEYS", m.cmdKeys)
// MIGRATE
srv.HandleFunc("MOVE", m.cmdMove)
// OBJECT
srv.HandleFunc("PERSIST", m.cmdPersist)
srv.HandleFunc("PEXPIRE", makeCmdExpire(m, "pexpire"))
srv.HandleFunc("PEXPIREAT", makeCmdExpire(m, "pexpireat"))
srv.HandleFunc("PTTL", m.cmdPTTL)
srv.HandleFunc("RANDOMKEY", m.cmdRandomkey)
srv.HandleFunc("RENAME", m.cmdRename)
srv.HandleFunc("RENAMENX", m.cmdRenamenx)
// RESTORE
// SORT
srv.HandleFunc("TTL", m.cmdTTL)
srv.HandleFunc("TYPE", m.cmdType)
srv.HandleFunc("SCAN", m.cmdScan)
}
示例9: commandsString
// commandsString handles all string value operations.
func commandsString(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("APPEND", m.cmdAppend)
srv.HandleFunc("BITCOUNT", m.cmdBitcount)
srv.HandleFunc("BITOP", m.cmdBitop)
srv.HandleFunc("BITPOS", m.cmdBitpos)
srv.HandleFunc("DECRBY", m.cmdDecrby)
srv.HandleFunc("DECR", m.cmdDecr)
srv.HandleFunc("GETBIT", m.cmdGetbit)
srv.HandleFunc("GET", m.cmdGet)
srv.HandleFunc("GETRANGE", m.cmdGetrange)
srv.HandleFunc("GETSET", m.cmdGetset)
srv.HandleFunc("INCRBYFLOAT", m.cmdIncrbyfloat)
srv.HandleFunc("INCRBY", m.cmdIncrby)
srv.HandleFunc("INCR", m.cmdIncr)
srv.HandleFunc("MGET", m.cmdMget)
srv.HandleFunc("MSET", m.cmdMset)
srv.HandleFunc("MSETNX", m.cmdMsetnx)
srv.HandleFunc("PSETEX", m.cmdPsetex)
srv.HandleFunc("SETBIT", m.cmdSetbit)
srv.HandleFunc("SETEX", m.cmdSetex)
srv.HandleFunc("SET", m.cmdSet)
srv.HandleFunc("SETNX", m.cmdSetnx)
srv.HandleFunc("SETRANGE", m.cmdSetrange)
srv.HandleFunc("STRLEN", m.cmdStrlen)
}
示例10: commandsString
func commandsString(m *Redico, srv *redeo.Server) {
srv.HandleFunc("GET", m.cmdGet)
srv.HandleFunc("SET", m.cmdSet)
srv.HandleFunc("INCR", m.cmdIncr)
}
示例11: commandsSortedSet
// commandsSortedSet handles all sorted set operations.
func commandsSortedSet(m *Miniredis, srv *redeo.Server) {
srv.HandleFunc("ZADD", m.cmdZadd)
srv.HandleFunc("ZCARD", m.cmdZcard)
srv.HandleFunc("ZCOUNT", m.cmdZcount)
srv.HandleFunc("ZINCRBY", m.cmdZincrby)
srv.HandleFunc("ZINTERSTORE", m.cmdZinterstore)
srv.HandleFunc("ZLEXCOUNT", m.cmdZlexcount)
srv.HandleFunc("ZRANGE", m.makeCmdZrange("zrange", false))
srv.HandleFunc("ZRANGEBYLEX", m.cmdZrangebylex)
srv.HandleFunc("ZRANGEBYSCORE", m.makeCmdZrangebyscore("zrangebyscore", false))
srv.HandleFunc("ZRANK", m.makeCmdZrank("zrank", false))
srv.HandleFunc("ZREM", m.cmdZrem)
srv.HandleFunc("ZREMRANGEBYLEX", m.cmdZremrangebylex)
srv.HandleFunc("ZREMRANGEBYRANK", m.cmdZremrangebyrank)
srv.HandleFunc("ZREMRANGEBYSCORE", m.cmdZremrangebyscore)
srv.HandleFunc("ZREVRANGE", m.makeCmdZrange("zrevrange", true))
srv.HandleFunc("ZREVRANGEBYSCORE", m.makeCmdZrangebyscore("zrevrangebyscore", true))
srv.HandleFunc("ZREVRANK", m.makeCmdZrank("zrevrank", true))
srv.HandleFunc("ZSCORE", m.cmdZscore)
srv.HandleFunc("ZUNIONSTORE", m.cmdZunionstore)
srv.HandleFunc("ZSCAN", m.cmdZscan)
}