client.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/live_user/api/liverpc/v1"
  7. "go-common/library/net/rpc/liverpc"
  8. )
  9. // Client that represents a liverpc live_user service api
  10. type Client struct {
  11. cli *liverpc.Client
  12. // V1Guard presents the controller in liverpc
  13. V1Guard v1.Guard
  14. // V1Note presents the controller in liverpc
  15. V1Note v1.Note
  16. // V1RoomAdmin presents the controller in liverpc
  17. V1RoomAdmin v1.RoomAdmin
  18. // V1UserSetting presents the controller in liverpc
  19. V1UserSetting v1.UserSetting
  20. }
  21. // DiscoveryAppId the discovery id is not the tree name
  22. var DiscoveryAppId = "live.liveuser"
  23. // New a Client that represents a liverpc live.liveuser service api
  24. // conf can be empty, and it will use discovery to find service by default
  25. // conf.AppID will be overwrite by a fixed value DiscoveryAppId
  26. // therefore is no need to set
  27. func New(conf *liverpc.ClientConfig) *Client {
  28. if conf == nil {
  29. conf = &liverpc.ClientConfig{}
  30. }
  31. conf.AppID = DiscoveryAppId
  32. var realCli = liverpc.NewClient(conf)
  33. cli := &Client{cli: realCli}
  34. cli.clientInit(realCli)
  35. return cli
  36. }
  37. func (cli *Client) GetRawCli() *liverpc.Client {
  38. return cli.cli
  39. }
  40. func (cli *Client) clientInit(realCli *liverpc.Client) {
  41. cli.V1Guard = v1.NewGuardRpcClient(realCli)
  42. cli.V1Note = v1.NewNoteRpcClient(realCli)
  43. cli.V1RoomAdmin = v1.NewRoomAdminRpcClient(realCli)
  44. cli.V1UserSetting = v1.NewUserSettingRpcClient(realCli)
  45. }