client.go 1.3 KB

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