client.go 1.4 KB

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