2.0订单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
448 B

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