client.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/room_ex/api/liverpc/v1"
  7. "go-common/library/net/rpc/liverpc"
  8. )
  9. // Client that represents a liverpc room_ex service api
  10. type Client struct {
  11. cli *liverpc.Client
  12. // V1BannerMng presents the controller in liverpc
  13. V1BannerMng v1.BannerMng
  14. // V1Banner presents the controller in liverpc
  15. V1Banner v1.Banner
  16. // V1RoomNews presents the controller in liverpc
  17. V1RoomNews v1.RoomNews
  18. }
  19. // DiscoveryAppId the discovery id is not the tree name
  20. var DiscoveryAppId = "live.roomex"
  21. // New a Client that represents a liverpc live.roomex service api
  22. // conf can be empty, and it will use discovery to find service by default
  23. // conf.AppID will be overwrite by a fixed value DiscoveryAppId
  24. // therefore is no need to set
  25. func New(conf *liverpc.ClientConfig) *Client {
  26. if conf == nil {
  27. conf = &liverpc.ClientConfig{}
  28. }
  29. conf.AppID = DiscoveryAppId
  30. var realCli = liverpc.NewClient(conf)
  31. cli := &Client{cli: realCli}
  32. cli.clientInit(realCli)
  33. return cli
  34. }
  35. func (cli *Client) GetRawCli() *liverpc.Client {
  36. return cli.cli
  37. }
  38. func (cli *Client) clientInit(realCli *liverpc.Client) {
  39. cli.V1BannerMng = v1.NewBannerMngRpcClient(realCli)
  40. cli.V1Banner = v1.NewBannerRpcClient(realCli)
  41. cli.V1RoomNews = v1.NewRoomNewsRpcClient(realCli)
  42. }