client.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Code generated by liverpcgen, DO NOT EDIT.
  2. // source: *.proto files under this directory
  3. // If you want to change this file, Please see README in go-common/app/tool/liverpc/protoc-gen-liverpc/
  4. package liverpc
  5. import (
  6. "go-common/app/service/live/av/api/liverpc/v0"
  7. "go-common/app/service/live/av/api/liverpc/v1"
  8. "go-common/library/net/rpc/liverpc"
  9. )
  10. // Client that represents a liverpc av service api
  11. type Client struct {
  12. cli *liverpc.Client
  13. // V0PayGoods presents the controller in liverpc
  14. V0PayGoods v0.PayGoods
  15. // V0PayLive presents the controller in liverpc
  16. V0PayLive v0.PayLive
  17. // V1PayLive presents the controller in liverpc
  18. V1PayLive v1.PayLive
  19. // V1Pk presents the controller in liverpc
  20. V1Pk v1.Pk
  21. }
  22. // DiscoveryAppId the discovery id is not the tree name
  23. var DiscoveryAppId = "live.av"
  24. // New a Client that represents a liverpc live.av service api
  25. // conf can be empty, and it will use discovery to find service by default
  26. // conf.AppID will be overwrite by a fixed value DiscoveryAppId
  27. // therefore is no need to set
  28. func New(conf *liverpc.ClientConfig) *Client {
  29. if conf == nil {
  30. conf = &liverpc.ClientConfig{}
  31. }
  32. conf.AppID = DiscoveryAppId
  33. var realCli = liverpc.NewClient(conf)
  34. cli := &Client{cli: realCli}
  35. cli.clientInit(realCli)
  36. return cli
  37. }
  38. func (cli *Client) GetRawCli() *liverpc.Client {
  39. return cli.cli
  40. }
  41. func (cli *Client) clientInit(realCli *liverpc.Client) {
  42. cli.V0PayGoods = v0.NewPayGoodsRpcClient(realCli)
  43. cli.V0PayLive = v0.NewPayLiveRpcClient(realCli)
  44. cli.V1PayLive = v1.NewPayLiveRpcClient(realCli)
  45. cli.V1Pk = v1.NewPkRpcClient(realCli)
  46. }