client.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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/userext/api/liverpc/v0"
  7. "go-common/app/service/live/userext/api/liverpc/v1"
  8. "go-common/library/net/rpc/liverpc"
  9. )
  10. // Client that represents a liverpc userext service api
  11. type Client struct {
  12. cli *liverpc.Client
  13. // V0Conf presents the controller in liverpc
  14. V0Conf v0.ConfRPCClient
  15. // V1Bubble presents the controller in liverpc
  16. V1Bubble v1.BubbleRPCClient
  17. // V1Color presents the controller in liverpc
  18. V1Color v1.ColorRPCClient
  19. // V1DanmuConf presents the controller in liverpc
  20. V1DanmuConf v1.DanmuConfRPCClient
  21. // V1GrayRule presents the controller in liverpc
  22. V1GrayRule v1.GrayRuleRPCClient
  23. // V1Remind presents the controller in liverpc
  24. V1Remind v1.RemindRPCClient
  25. // V1Tag presents the controller in liverpc
  26. V1Tag v1.TagRPCClient
  27. }
  28. // DiscoveryAppId the discovery id is not the tree name
  29. var DiscoveryAppId = "live.userext"
  30. // New a Client that represents a liverpc live.userext service api
  31. // conf can be empty, and it will use discovery to find service by default
  32. // conf.AppID will be overwrite by a fixed value DiscoveryAppId
  33. // therefore is no need to set
  34. func New(conf *liverpc.ClientConfig) *Client {
  35. if conf == nil {
  36. conf = &liverpc.ClientConfig{}
  37. }
  38. conf.AppID = DiscoveryAppId
  39. var realCli = liverpc.NewClient(conf)
  40. cli := &Client{cli: realCli}
  41. cli.clientInit(realCli)
  42. return cli
  43. }
  44. func (cli *Client) GetRawCli() *liverpc.Client {
  45. return cli.cli
  46. }
  47. func (cli *Client) clientInit(realCli *liverpc.Client) {
  48. cli.V0Conf = v0.NewConfRPCClient(realCli)
  49. cli.V1Bubble = v1.NewBubbleRPCClient(realCli)
  50. cli.V1Color = v1.NewColorRPCClient(realCli)
  51. cli.V1DanmuConf = v1.NewDanmuConfRPCClient(realCli)
  52. cli.V1GrayRule = v1.NewGrayRuleRPCClient(realCli)
  53. cli.V1Remind = v1.NewRemindRPCClient(realCli)
  54. cli.V1Tag = v1.NewTagRPCClient(realCli)
  55. }