client.go 1.2 KB

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