package supplierrpc
|
|
|
|
import (
|
|
"git.tetele.net/tgo/conf"
|
|
)
|
|
|
|
var DES_KEY = "suppli22"
|
|
|
|
func rpc_server_conn(url ...string) (*SupplierServiceClient, error) {
|
|
|
|
var rpc_url string
|
|
if len(url) > 0 && url[0] != "" {
|
|
rpc_url = url[0]
|
|
} else if conf.SUPPLIER_RPC_URL != "" {
|
|
rpc_url = conf.SUPPLIER_RPC_URL
|
|
} else {
|
|
rpc_url = "127.0.0.1:" + conf.SUPPLIER_RPC_PORT
|
|
}
|
|
|
|
conn, _, err := DialSupplierService("tcp", rpc_url)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return conn, nil
|
|
|
|
}
|