client.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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/api/liverpc/v1"
  7. "go-common/app/service/live/room/api/liverpc/v2"
  8. "go-common/library/net/rpc/liverpc"
  9. )
  10. // Client that represents a liverpc room service api
  11. type Client struct {
  12. cli *liverpc.Client
  13. // V1AppIndex presents the controller in liverpc
  14. V1AppIndex v1.AppIndexRPCClient
  15. // V1Area presents the controller in liverpc
  16. V1Area v1.AreaRPCClient
  17. // V1Room presents the controller in liverpc
  18. V1Room v1.RoomRPCClient
  19. // V1RoomEx presents the controller in liverpc
  20. V1RoomEx v1.RoomExRPCClient
  21. // V1RoomMng presents the controller in liverpc
  22. V1RoomMng v1.RoomMngRPCClient
  23. // V1RoomPendant presents the controller in liverpc
  24. V1RoomPendant v1.RoomPendantRPCClient
  25. // V1RoomRecommend presents the controller in liverpc
  26. V1RoomRecommend v1.RoomRecommendRPCClient
  27. // V1Skin presents the controller in liverpc
  28. V1Skin v1.SkinRPCClient
  29. // V2AppIndex presents the controller in liverpc
  30. V2AppIndex v2.AppIndexRPCClient
  31. // V2Room presents the controller in liverpc
  32. V2Room v2.RoomRPCClient
  33. }
  34. // DiscoveryAppId the discovery id is not the tree name
  35. var DiscoveryAppId = "live.room"
  36. // New a Client that represents a liverpc live.room service api
  37. // conf can be empty, and it will use discovery to find service by default
  38. // conf.AppID will be overwrite by a fixed value DiscoveryAppId
  39. // therefore is no need to set
  40. func New(conf *liverpc.ClientConfig) *Client {
  41. if conf == nil {
  42. conf = &liverpc.ClientConfig{}
  43. }
  44. conf.AppID = DiscoveryAppId
  45. var realCli = liverpc.NewClient(conf)
  46. cli := &Client{cli: realCli}
  47. cli.clientInit(realCli)
  48. return cli
  49. }
  50. func (cli *Client) GetRawCli() *liverpc.Client {
  51. return cli.cli
  52. }
  53. func (cli *Client) clientInit(realCli *liverpc.Client) {
  54. cli.V1AppIndex = v1.NewAppIndexRPCClient(realCli)
  55. cli.V1Area = v1.NewAreaRPCClient(realCli)
  56. cli.V1Room = v1.NewRoomRPCClient(realCli)
  57. cli.V1RoomEx = v1.NewRoomExRPCClient(realCli)
  58. cli.V1RoomMng = v1.NewRoomMngRPCClient(realCli)
  59. cli.V1RoomPendant = v1.NewRoomPendantRPCClient(realCli)
  60. cli.V1RoomRecommend = v1.NewRoomRecommendRPCClient(realCli)
  61. cli.V1Skin = v1.NewSkinRPCClient(realCli)
  62. cli.V2AppIndex = v2.NewAppIndexRPCClient(realCli)
  63. cli.V2Room = v2.NewRoomRPCClient(realCli)
  64. }