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/rc/api/liverpc/v0"
  7. "go-common/app/service/live/rc/api/liverpc/v1"
  8. "go-common/library/net/rpc/liverpc"
  9. )
  10. // Client that represents a liverpc rc service api
  11. type Client struct {
  12. cli *liverpc.Client
  13. // V0Broadcast presents the controller in liverpc
  14. V0Broadcast v0.BroadcastRPCClient
  15. // V1Achv presents the controller in liverpc
  16. V1Achv v1.AchvRPCClient
  17. // V1TitleStuff presents the controller in liverpc
  18. V1TitleStuff v1.TitleStuffRPCClient
  19. // V1UserTitle presents the controller in liverpc
  20. V1UserTitle v1.UserTitleRPCClient
  21. }
  22. // DiscoveryAppId the discovery id is not the tree name
  23. var DiscoveryAppId = "live.rc"
  24. // New a Client that represents a liverpc live.rc 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.V0Broadcast = v0.NewBroadcastRPCClient(realCli)
  43. cli.V1Achv = v1.NewAchvRPCClient(realCli)
  44. cli.V1TitleStuff = v1.NewTitleStuffRPCClient(realCli)
  45. cli.V1UserTitle = v1.NewUserTitleRPCClient(realCli)
  46. }