redis rpc服务, 提供redis操作方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
387 B

package redisrpc
import (
"net/rpc"
"git.tetele.net/tgo/conf"
)
func Conn(url ...string) (*RedisServiceClient, *rpc.Client, error) {
var rpc_url string
if len(url) > 0 && url[0] != "" {
rpc_url = url[0]
} else if conf.REDIS_RPC_URL != "" {
rpc_url = conf.REDIS_RPC_URL
} else {
rpc_url = "127.0.0.1:" + conf.REDIS_RPC_PORT
}
return DialRedisService("tcp", rpc_url)
}