商品rpc数据格式及调用方法
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.

23 lines
449 B

package productrpc
import (
"git.tetele.net/tgo/conf"
)
func rpc_server_conn(url ...string) (*ProductServiceClient, error) {
var rpc_url string
if len(url) > 0 && url[0] != "" {
rpc_url = url[0]
} else if conf.PRODUCT_RPC_URL != "" {
rpc_url = conf.PRODUCT_RPC_URL
} else {
rpc_url = "127.0.0.1:" + conf.PRODUCT_RPC_PORT
}
conn, _, err := DialProductService("tcp", rpc_url)
if err != nil {
return nil, err
}
return conn, nil
}