优惠券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.

26 lines
472 B

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