当前位置: 首页>>代码示例>>Golang>>正文


Golang Server.HandleFunc方法代码示例

本文整理汇总了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)
}
开发者ID:jameswei,项目名称:xcodis,代码行数:8,代码来源:cmd_transactions.go

示例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)
}
开发者ID:yqj2012,项目名称:Coolpy5Sub,代码行数:7,代码来源:cmd_connnection.go

示例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)
}
开发者ID:yqj2012,项目名称:Coolpy5Sub,代码行数:10,代码来源:cmd_generic.go

示例4: commandsServer

func commandsServer(m *Miniredis, srv *redeo.Server) {
	srv.HandleFunc("DBSIZE", m.cmdDbsize)
	srv.HandleFunc("FLUSHALL", m.cmdFlushall)
	srv.HandleFunc("FLUSHDB", m.cmdFlushdb)
}
开发者ID:Goyoo,项目名称:codis-docker,代码行数:5,代码来源:cmd_server.go

示例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)
}
开发者ID:Goyoo,项目名称:codis-docker,代码行数:20,代码来源:cmd_list.go

示例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)
}
开发者ID:jameswei,项目名称:xcodis,代码行数:17,代码来源:cmd_hash.go

示例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)
}
开发者ID:jameswei,项目名称:xcodis,代码行数:18,代码来源:cmd_set.go

示例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)
}
开发者ID:Goyoo,项目名称:codis-docker,代码行数:24,代码来源:cmd_generic.go

示例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)
}
开发者ID:Goyoo,项目名称:codis-docker,代码行数:26,代码来源:cmd_string.go

示例10: commandsString

func commandsString(m *Redico, srv *redeo.Server) {
	srv.HandleFunc("GET", m.cmdGet)
	srv.HandleFunc("SET", m.cmdSet)
	srv.HandleFunc("INCR", m.cmdIncr)
}
开发者ID:yqj2012,项目名称:Coolpy5Sub,代码行数:5,代码来源:cmd_string.go

示例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)
}
开发者ID:shorrockin,项目名称:miniredis,代码行数:23,代码来源:cmd_sorted_set.go


注:本文中的github.com/bsm/redeo.Server.HandleFunc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。