63 lines
1.6 KiB
Go
63 lines
1.6 KiB
Go
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
|
|
// source: v1/Captcha.proto
|
|
|
|
/*
|
|
Package v1 is a generated liverpc stub package.
|
|
This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
|
|
|
|
It is generated from these files:
|
|
v1/Captcha.proto
|
|
*/
|
|
package v1
|
|
|
|
import context "context"
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import "go-common/library/net/rpc/liverpc"
|
|
|
|
var _ proto.Message // generate to suppress unused imports
|
|
// Imports only used by utility functions:
|
|
|
|
// =================
|
|
// Captcha Interface
|
|
// =================
|
|
|
|
type CaptchaRPCClient interface {
|
|
// * 创建图片数字验证码
|
|
//
|
|
Create(ctx context.Context, req *CaptchaCreateReq, opts ...liverpc.CallOption) (resp *CaptchaCreateResp, err error)
|
|
}
|
|
|
|
// =======================
|
|
// Captcha Live Rpc Client
|
|
// =======================
|
|
|
|
type captchaRPCClient struct {
|
|
client *liverpc.Client
|
|
}
|
|
|
|
// NewCaptchaRPCClient creates a client that implements the CaptchaRPCClient interface.
|
|
func NewCaptchaRPCClient(client *liverpc.Client) CaptchaRPCClient {
|
|
return &captchaRPCClient{
|
|
client: client,
|
|
}
|
|
}
|
|
|
|
func (c *captchaRPCClient) Create(ctx context.Context, in *CaptchaCreateReq, opts ...liverpc.CallOption) (*CaptchaCreateResp, error) {
|
|
out := new(CaptchaCreateResp)
|
|
err := doRPCRequest(ctx, c.client, 1, "Captcha.create", in, out, opts)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// =====
|
|
// Utils
|
|
// =====
|
|
|
|
func doRPCRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message, opts []liverpc.CallOption) (err error) {
|
|
err = client.Call(ctx, version, method, in, out, opts...)
|
|
return
|
|
}
|