Documentation
¶
Index ¶
- Variables
- func RegisterCaptchaServiceServer(s *grpc.Server, srv CaptchaServiceServer)
- type AsyncCodeReq
- func (*AsyncCodeReq) Descriptor() ([]byte, []int)deprecated
- func (x *AsyncCodeReq) GetContact() string
- func (x *AsyncCodeReq) GetPurpose() Purpose
- func (*AsyncCodeReq) ProtoMessage()
- func (x *AsyncCodeReq) ProtoReflect() protoreflect.Message
- func (x *AsyncCodeReq) Reset()
- func (x *AsyncCodeReq) String() string
- type AsyncCodeRsp
- type Captcha
- func (*Captcha) Descriptor() ([]byte, []int)deprecated
- func (x *Captcha) GetContent() string
- func (x *Captcha) GetDeadline() int64
- func (x *Captcha) GetKey() string
- func (x *Captcha) GetMessage() string
- func (x *Captcha) GetPurpose() Purpose
- func (*Captcha) ProtoMessage()
- func (x *Captcha) ProtoReflect() protoreflect.Message
- func (x *Captcha) Reset()
- func (x *Captcha) String() string
- type CaptchaServiceClient
- type CaptchaServiceServer
- type GraphCaptchaReq
- type GraphCaptchaRsp
- type Purpose
- type UnimplementedCaptchaServiceServer
- func (*UnimplementedCaptchaServiceServer) AsyncCode(context.Context, *AsyncCodeReq) (*AsyncCodeRsp, error)
- func (*UnimplementedCaptchaServiceServer) GraphCaptcha(context.Context, *GraphCaptchaReq) (*GraphCaptchaRsp, error)
- func (*UnimplementedCaptchaServiceServer) Verify(context.Context, *VerifyReq) (*VerifyRsp, error)
- type VerifyReq
- func (*VerifyReq) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyReq) GetKey() string
- func (x *VerifyReq) GetPurpose() Purpose
- func (x *VerifyReq) GetValue() string
- func (*VerifyReq) ProtoMessage()
- func (x *VerifyReq) ProtoReflect() protoreflect.Message
- func (x *VerifyReq) Reset()
- func (x *VerifyReq) String() string
- type VerifyRsp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Purpose_name = map[int32]string{ 0: "SIGN_UP", 1: "SIGN_IN", 2: "RESET_PASSWD", } Purpose_value = map[string]int32{ "SIGN_UP": 0, "SIGN_IN": 1, "RESET_PASSWD": 2, } )
Enum value maps for Purpose.
View Source
var File_api_grpc_captcha_captcha_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCaptchaServiceServer ¶
func RegisterCaptchaServiceServer(s *grpc.Server, srv CaptchaServiceServer)
Types ¶
type AsyncCodeReq ¶
type AsyncCodeReq struct { // email or phone Contact string `protobuf:"bytes,1,opt,name=contact,proto3" json:"contact,omitempty"` Purpose Purpose `protobuf:"varint,2,opt,name=purpose,proto3,enum=captcha.Purpose" json:"purpose,omitempty"` // contains filtered or unexported fields }
func (*AsyncCodeReq) Descriptor
deprecated
func (*AsyncCodeReq) Descriptor() ([]byte, []int)
Deprecated: Use AsyncCodeReq.ProtoReflect.Descriptor instead.
func (*AsyncCodeReq) GetContact ¶
func (x *AsyncCodeReq) GetContact() string
func (*AsyncCodeReq) GetPurpose ¶
func (x *AsyncCodeReq) GetPurpose() Purpose
func (*AsyncCodeReq) ProtoMessage ¶
func (*AsyncCodeReq) ProtoMessage()
func (*AsyncCodeReq) ProtoReflect ¶
func (x *AsyncCodeReq) ProtoReflect() protoreflect.Message
func (*AsyncCodeReq) Reset ¶
func (x *AsyncCodeReq) Reset()
func (*AsyncCodeReq) String ¶
func (x *AsyncCodeReq) String() string
type AsyncCodeRsp ¶
type AsyncCodeRsp struct {
// contains filtered or unexported fields
}
func (*AsyncCodeRsp) Descriptor
deprecated
func (*AsyncCodeRsp) Descriptor() ([]byte, []int)
Deprecated: Use AsyncCodeRsp.ProtoReflect.Descriptor instead.
func (*AsyncCodeRsp) ProtoMessage ¶
func (*AsyncCodeRsp) ProtoMessage()
func (*AsyncCodeRsp) ProtoReflect ¶
func (x *AsyncCodeRsp) ProtoReflect() protoreflect.Message
func (*AsyncCodeRsp) Reset ¶
func (x *AsyncCodeRsp) Reset()
func (*AsyncCodeRsp) String ¶
func (x *AsyncCodeRsp) String() string
type Captcha ¶
type Captcha struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Purpose Purpose `protobuf:"varint,2,opt,name=purpose,proto3,enum=captcha.Purpose" json:"purpose,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` Deadline int64 `protobuf:"varint,5,opt,name=deadline,proto3" json:"deadline,omitempty"` // contains filtered or unexported fields }
func (*Captcha) Descriptor
deprecated
func (*Captcha) GetContent ¶
func (*Captcha) GetDeadline ¶
func (*Captcha) GetMessage ¶
func (*Captcha) GetPurpose ¶
func (*Captcha) ProtoMessage ¶
func (*Captcha) ProtoMessage()
func (*Captcha) ProtoReflect ¶
func (x *Captcha) ProtoReflect() protoreflect.Message
type CaptchaServiceClient ¶
type CaptchaServiceClient interface { // 异步验证码 用于短信/邮箱等 AsyncCode(ctx context.Context, in *AsyncCodeReq, opts ...grpc.CallOption) (*AsyncCodeRsp, error) // 图形验证码 GraphCaptcha(ctx context.Context, in *GraphCaptchaReq, opts ...grpc.CallOption) (*GraphCaptchaRsp, error) // 验证码校验 Verify(ctx context.Context, in *VerifyReq, opts ...grpc.CallOption) (*VerifyRsp, error) }
CaptchaServiceClient is the client API for CaptchaService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCaptchaServiceClient ¶
func NewCaptchaServiceClient(cc grpc.ClientConnInterface) CaptchaServiceClient
type CaptchaServiceServer ¶
type CaptchaServiceServer interface { // 异步验证码 用于短信/邮箱等 AsyncCode(context.Context, *AsyncCodeReq) (*AsyncCodeRsp, error) // 图形验证码 GraphCaptcha(context.Context, *GraphCaptchaReq) (*GraphCaptchaRsp, error) // 验证码校验 Verify(context.Context, *VerifyReq) (*VerifyRsp, error) }
CaptchaServiceServer is the server API for CaptchaService service.
type GraphCaptchaReq ¶
type GraphCaptchaReq struct { Purpose Purpose `protobuf:"varint,1,opt,name=purpose,proto3,enum=captcha.Purpose" json:"purpose,omitempty"` // contains filtered or unexported fields }
func (*GraphCaptchaReq) Descriptor
deprecated
func (*GraphCaptchaReq) Descriptor() ([]byte, []int)
Deprecated: Use GraphCaptchaReq.ProtoReflect.Descriptor instead.
func (*GraphCaptchaReq) GetPurpose ¶
func (x *GraphCaptchaReq) GetPurpose() Purpose
func (*GraphCaptchaReq) ProtoMessage ¶
func (*GraphCaptchaReq) ProtoMessage()
func (*GraphCaptchaReq) ProtoReflect ¶
func (x *GraphCaptchaReq) ProtoReflect() protoreflect.Message
func (*GraphCaptchaReq) Reset ¶
func (x *GraphCaptchaReq) Reset()
func (*GraphCaptchaReq) String ¶
func (x *GraphCaptchaReq) String() string
type GraphCaptchaRsp ¶
type GraphCaptchaRsp struct { Captcha *Captcha `protobuf:"bytes,1,opt,name=captcha,proto3" json:"captcha,omitempty"` // contains filtered or unexported fields }
func (*GraphCaptchaRsp) Descriptor
deprecated
func (*GraphCaptchaRsp) Descriptor() ([]byte, []int)
Deprecated: Use GraphCaptchaRsp.ProtoReflect.Descriptor instead.
func (*GraphCaptchaRsp) GetCaptcha ¶
func (x *GraphCaptchaRsp) GetCaptcha() *Captcha
func (*GraphCaptchaRsp) ProtoMessage ¶
func (*GraphCaptchaRsp) ProtoMessage()
func (*GraphCaptchaRsp) ProtoReflect ¶
func (x *GraphCaptchaRsp) ProtoReflect() protoreflect.Message
func (*GraphCaptchaRsp) Reset ¶
func (x *GraphCaptchaRsp) Reset()
func (*GraphCaptchaRsp) String ¶
func (x *GraphCaptchaRsp) String() string
type Purpose ¶
type Purpose int32
通过purpose字段限制用途
func (Purpose) Descriptor ¶
func (Purpose) Descriptor() protoreflect.EnumDescriptor
func (Purpose) EnumDescriptor
deprecated
func (Purpose) Number ¶
func (x Purpose) Number() protoreflect.EnumNumber
func (Purpose) Type ¶
func (Purpose) Type() protoreflect.EnumType
type UnimplementedCaptchaServiceServer ¶
type UnimplementedCaptchaServiceServer struct { }
UnimplementedCaptchaServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCaptchaServiceServer) AsyncCode ¶
func (*UnimplementedCaptchaServiceServer) AsyncCode(context.Context, *AsyncCodeReq) (*AsyncCodeRsp, error)
func (*UnimplementedCaptchaServiceServer) GraphCaptcha ¶
func (*UnimplementedCaptchaServiceServer) GraphCaptcha(context.Context, *GraphCaptchaReq) (*GraphCaptchaRsp, error)
type VerifyReq ¶
type VerifyReq struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Purpose Purpose `protobuf:"varint,3,opt,name=purpose,proto3,enum=captcha.Purpose" json:"purpose,omitempty"` // contains filtered or unexported fields }
func (*VerifyReq) Descriptor
deprecated
func (*VerifyReq) GetPurpose ¶
func (*VerifyReq) ProtoMessage ¶
func (*VerifyReq) ProtoMessage()
func (*VerifyReq) ProtoReflect ¶
func (x *VerifyReq) ProtoReflect() protoreflect.Message
type VerifyRsp ¶
type VerifyRsp struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*VerifyRsp) Descriptor
deprecated
func (*VerifyRsp) GetSuccess ¶
func (*VerifyRsp) ProtoMessage ¶
func (*VerifyRsp) ProtoMessage()
func (*VerifyRsp) ProtoReflect ¶
func (x *VerifyRsp) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.