captcha

package
v0.0.0-...-8710d28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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) Descriptor() ([]byte, []int)

Deprecated: Use Captcha.ProtoReflect.Descriptor instead.

func (*Captcha) GetContent

func (x *Captcha) GetContent() string

func (*Captcha) GetDeadline

func (x *Captcha) GetDeadline() int64

func (*Captcha) GetKey

func (x *Captcha) GetKey() string

func (*Captcha) GetMessage

func (x *Captcha) GetMessage() string

func (*Captcha) GetPurpose

func (x *Captcha) GetPurpose() Purpose

func (*Captcha) ProtoMessage

func (*Captcha) ProtoMessage()

func (*Captcha) ProtoReflect

func (x *Captcha) ProtoReflect() protoreflect.Message

func (*Captcha) Reset

func (x *Captcha) Reset()

func (*Captcha) String

func (x *Captcha) String() string

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.

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字段限制用途

const (
	Purpose_SIGN_UP      Purpose = 0 // 注册
	Purpose_SIGN_IN      Purpose = 1 // 登入
	Purpose_RESET_PASSWD Purpose = 2 // 重置密码
)

func (Purpose) Descriptor

func (Purpose) Descriptor() protoreflect.EnumDescriptor

func (Purpose) Enum

func (x Purpose) Enum() *Purpose

func (Purpose) EnumDescriptor deprecated

func (Purpose) EnumDescriptor() ([]byte, []int)

Deprecated: Use Purpose.Descriptor instead.

func (Purpose) Number

func (x Purpose) Number() protoreflect.EnumNumber

func (Purpose) String

func (x Purpose) String() string

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) GraphCaptcha

func (*UnimplementedCaptchaServiceServer) Verify

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) Descriptor() ([]byte, []int)

Deprecated: Use VerifyReq.ProtoReflect.Descriptor instead.

func (*VerifyReq) GetKey

func (x *VerifyReq) GetKey() string

func (*VerifyReq) GetPurpose

func (x *VerifyReq) GetPurpose() Purpose

func (*VerifyReq) GetValue

func (x *VerifyReq) GetValue() string

func (*VerifyReq) ProtoMessage

func (*VerifyReq) ProtoMessage()

func (*VerifyReq) ProtoReflect

func (x *VerifyReq) ProtoReflect() protoreflect.Message

func (*VerifyReq) Reset

func (x *VerifyReq) Reset()

func (*VerifyReq) String

func (x *VerifyReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use VerifyRsp.ProtoReflect.Descriptor instead.

func (*VerifyRsp) GetSuccess

func (x *VerifyRsp) GetSuccess() bool

func (*VerifyRsp) ProtoMessage

func (*VerifyRsp) ProtoMessage()

func (*VerifyRsp) ProtoReflect

func (x *VerifyRsp) ProtoReflect() protoreflect.Message

func (*VerifyRsp) Reset

func (x *VerifyRsp) Reset()

func (*VerifyRsp) String

func (x *VerifyRsp) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL