Captcha.liverpc.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v0/Captcha.proto
  3. /*
  4. Package v0 is a generated liverpc stub package.
  5. This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
  6. It is generated from these files:
  7. v0/Captcha.proto
  8. */
  9. package v0
  10. import context "context"
  11. import proto "github.com/golang/protobuf/proto"
  12. import "go-common/library/net/rpc/liverpc"
  13. var _ proto.Message // generate to suppress unused imports
  14. // Imports only used by utility functions:
  15. // =================
  16. // Captcha Interface
  17. // =================
  18. type CaptchaRPCClient interface {
  19. // * 校验验证码
  20. //
  21. Check(ctx context.Context, req *CaptchaCheckReq, opts ...liverpc.CallOption) (resp *CaptchaCheckResp, err error)
  22. }
  23. // =======================
  24. // Captcha Live Rpc Client
  25. // =======================
  26. type captchaRPCClient struct {
  27. client *liverpc.Client
  28. }
  29. // NewCaptchaRPCClient creates a client that implements the CaptchaRPCClient interface.
  30. func NewCaptchaRPCClient(client *liverpc.Client) CaptchaRPCClient {
  31. return &captchaRPCClient{
  32. client: client,
  33. }
  34. }
  35. func (c *captchaRPCClient) Check(ctx context.Context, in *CaptchaCheckReq, opts ...liverpc.CallOption) (*CaptchaCheckResp, error) {
  36. out := new(CaptchaCheckResp)
  37. err := doRPCRequest(ctx, c.client, 0, "Captcha.check", in, out, opts)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. // =====
  44. // Utils
  45. // =====
  46. func doRPCRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message, opts []liverpc.CallOption) (err error) {
  47. err = client.Call(ctx, version, method, in, out, opts...)
  48. return
  49. }