商品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.

19 lines
356 B

  1. package productrpc
  2. import (
  3. "git.tetele.net/tgo/conf"
  4. )
  5. func rpc_server_conn(url ...string) (*ProductServiceClient, error) {
  6. var rpc_url string = "127.0.0.1:" + conf.PRODUCT_RPC_PORT
  7. if len(url) > 0 && url[0] != "" {
  8. rpc_url = url[0]
  9. }
  10. conn, _, err := DialProductService("tcp", rpc_url)
  11. if err != nil {
  12. return nil, err
  13. }
  14. return conn, nil
  15. }