|
@ -1,6 +1,7 @@ |
|
|
package redisrpc |
|
|
package redisrpc |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"log" |
|
|
"net/rpc" |
|
|
"net/rpc" |
|
|
|
|
|
|
|
|
"git.tetele.net/tgo/conf" |
|
|
"git.tetele.net/tgo/conf" |
|
@ -8,6 +9,8 @@ import ( |
|
|
|
|
|
|
|
|
func Conn(url ...string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
func Conn(url ...string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
|
|
|
|
|
|
|
|
|
log.Println("conn redis rpc server========", url) |
|
|
|
|
|
|
|
|
var rpc_url string |
|
|
var rpc_url string |
|
|
if len(url) > 0 && url[0] != "" { |
|
|
if len(url) > 0 && url[0] != "" { |
|
|
rpc_url = url[0] |
|
|
rpc_url = url[0] |
|
@ -17,6 +20,8 @@ func Conn(url ...string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
rpc_url = "127.0.0.1:" + conf.REDIS_RPC_PORT |
|
|
rpc_url = "127.0.0.1:" + conf.REDIS_RPC_PORT |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.Println("rpc_url", rpc_url) |
|
|
|
|
|
|
|
|
return DialRedisService("tcp", rpc_url) |
|
|
return DialRedisService("tcp", rpc_url) |
|
|
|
|
|
|
|
|
} |
|
|
} |