|
|
@ -1,14 +1,23 @@ |
|
|
|
package siterpc |
|
|
|
|
|
|
|
import ( |
|
|
|
"git.tetele.net/tgo/conf" |
|
|
|
) |
|
|
|
|
|
|
|
var DES_KEY = "confdata" |
|
|
|
|
|
|
|
func rpc_server_conn(url ...string) (*SiteServiceClient, error) { |
|
|
|
|
|
|
|
var wx_rpc_url string = "127.0.0.1:7971" |
|
|
|
var rpc_url string |
|
|
|
if len(url) > 0 && url[0] != "" { |
|
|
|
wx_rpc_url = url[0] |
|
|
|
rpc_url = url[0] |
|
|
|
} else if conf.SITE_RPC_URL != "" { |
|
|
|
rpc_url = conf.SITE_RPC_URL |
|
|
|
} else { |
|
|
|
rpc_url = "127.0.0.1:" + conf.SITE_RPC_PORT |
|
|
|
} |
|
|
|
conn, _, err := DialSiteService("tcp", wx_rpc_url) |
|
|
|
|
|
|
|
conn, _, err := DialSiteService("tcp", rpc_url) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|