Captcha.liverpc.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/Captcha.proto
  3. /*
  4. Package v1 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. v1/Captcha.proto
  8. */
  9. package v1
  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. Create(ctx context.Context, req *CaptchaCreateReq, opts ...liverpc.CallOption) (resp *CaptchaCreateResp, 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) Create(ctx context.Context, in *CaptchaCreateReq, opts ...liverpc.CallOption) (*CaptchaCreateResp, error) {
  36. out := new(CaptchaCreateResp)
  37. err := doRPCRequest(ctx, c.client, 1, "Captcha.create", 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. }