captcha

package
v0.0.0-...-49c8f32 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-auth. DO NOT EDIT! source: code.proto

Package captcha is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Code generated by protoc-gen-auth. DO NOT EDIT! source: include.proto

Code generated by protoc-gen-auth. DO NOT EDIT! source: inner_code.proto

Package captcha is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Category_name = map[int32]string{
	0: "CATEGORY_UNSPECIFIED",
	1: "CATEGORY_REGISTER",
	2: "CATEGORY_LOGIN",
	3: "CATEGORY_RESET_PWD",
	4: "CATEGORY_BIND",
	5: "CATEGORY_UNBIND",
}
View Source
var Category_value = map[string]int32{
	"CATEGORY_UNSPECIFIED": 0,
	"CATEGORY_REGISTER":    1,
	"CATEGORY_LOGIN":       2,
	"CATEGORY_RESET_PWD":   3,
	"CATEGORY_BIND":        4,
	"CATEGORY_UNBIND":      5,
}
View Source
var Channel_name = map[int32]string{
	0: "CHANNEL_UNSPECIFIED",
	1: "CHANNEL_EMAIL",
	2: "CHANNEL_SMS",
	3: "CHANNEL_PHONE",
	4: "CHANNEL_OTP",
}
View Source
var Channel_value = map[string]int32{
	"CHANNEL_UNSPECIFIED": 0,
	"CHANNEL_EMAIL":       1,
	"CHANNEL_SMS":         2,
	"CHANNEL_PHONE":       3,
	"CHANNEL_OTP":         4,
}

Functions

func RegisterCodeHandler

func RegisterCodeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCodeHandler registers the http handlers for service Code to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCodeHandlerClient

func RegisterCodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CodeClient) error

RegisterCodeHandlerClient registers the http handlers for service Code to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CodeClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CodeClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CodeClient" to call the correct interceptors.

func RegisterCodeHandlerFromEndpoint

func RegisterCodeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCodeHandlerFromEndpoint is same as RegisterCodeHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCodeHandlerServer

func RegisterCodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CodeServer) error

RegisterCodeHandlerServer registers the http handlers for service Code to "mux". UnaryRPC :call CodeServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterCodeScopeServer

func RegisterCodeScopeServer(component string, auth service.Authenticator, impl service.Implementor, srv CodeServer) error

Register scoped server.

func RegisterCodeServer

func RegisterCodeServer(s *grpc.Server, srv CodeServer)

func RegisterInnerCodeHandler

func RegisterInnerCodeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterInnerCodeHandler registers the http handlers for service InnerCode to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterInnerCodeHandlerClient

func RegisterInnerCodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InnerCodeClient) error

RegisterInnerCodeHandlerClient registers the http handlers for service InnerCode to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InnerCodeClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InnerCodeClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "InnerCodeClient" to call the correct interceptors.

func RegisterInnerCodeHandlerFromEndpoint

func RegisterInnerCodeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterInnerCodeHandlerFromEndpoint is same as RegisterInnerCodeHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterInnerCodeHandlerServer

func RegisterInnerCodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InnerCodeServer) error

RegisterInnerCodeHandlerServer registers the http handlers for service InnerCode to "mux". UnaryRPC :call InnerCodeServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterInnerCodeScopeServer

func RegisterInnerCodeScopeServer(component string, auth service.Authenticator, impl service.Implementor, srv InnerCodeServer) error

Register scoped server.

func RegisterInnerCodeServer

func RegisterInnerCodeServer(s *grpc.Server, srv InnerCodeServer)

Types

type Category

type Category int32

Captcha code category enums.

const (
	Category_CATEGORY_UNSPECIFIED Category = 0
	Category_CATEGORY_REGISTER    Category = 1
	Category_CATEGORY_LOGIN       Category = 2
	Category_CATEGORY_RESET_PWD   Category = 3
	Category_CATEGORY_BIND        Category = 4
	Category_CATEGORY_UNBIND      Category = 5
)

func (Category) Enum

func (x Category) Enum() *Category

func (Category) EnumDescriptor

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

func (Category) String

func (x Category) String() string

func (*Category) UnmarshalJSON

func (x *Category) UnmarshalJSON(data []byte) error

type Channel

type Channel int32

Captcha code channel enums.

const (
	Channel_CHANNEL_UNSPECIFIED Channel = 0
	Channel_CHANNEL_EMAIL       Channel = 1
	Channel_CHANNEL_SMS         Channel = 2
	Channel_CHANNEL_PHONE       Channel = 3
	Channel_CHANNEL_OTP         Channel = 4
)

func (Channel) Enum

func (x Channel) Enum() *Channel

func (Channel) EnumDescriptor

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

func (Channel) String

func (x Channel) String() string

func (*Channel) UnmarshalJSON

func (x *Channel) UnmarshalJSON(data []byte) error

type CodeClient

type CodeClient interface {
	// Get regions.
	GetRegions(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Regions, error)
	// Launch verification code process.
	Apply(ctx context.Context, in *CodeRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

CodeClient is the client API for Code service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewCodeClient

func NewCodeClient(cc *grpc.ClientConn) CodeClient

type CodeRequest

type CodeRequest struct {
	Channel              *Channel  `protobuf:"varint,1,req,name=channel,enum=appootb.captcha.Channel" json:"channel,omitempty"`
	Category             *Category `protobuf:"varint,2,req,name=category,enum=appootb.captcha.Category" json:"category,omitempty"`
	Target               *string   `protobuf:"bytes,3,req,name=target" json:"target,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

Captcha code request.

func (*CodeRequest) Descriptor

func (*CodeRequest) Descriptor() ([]byte, []int)

func (*CodeRequest) GetCategory

func (m *CodeRequest) GetCategory() Category

func (*CodeRequest) GetChannel

func (m *CodeRequest) GetChannel() Channel

func (*CodeRequest) GetTarget

func (m *CodeRequest) GetTarget() string

func (*CodeRequest) ProtoMessage

func (*CodeRequest) ProtoMessage()

func (*CodeRequest) Reset

func (m *CodeRequest) Reset()

func (*CodeRequest) String

func (m *CodeRequest) String() string

func (*CodeRequest) Validate

func (m *CodeRequest) Validate() error

Validate checks the field values on CodeRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*CodeRequest) XXX_DiscardUnknown

func (m *CodeRequest) XXX_DiscardUnknown()

func (*CodeRequest) XXX_Marshal

func (m *CodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CodeRequest) XXX_Merge

func (m *CodeRequest) XXX_Merge(src proto.Message)

func (*CodeRequest) XXX_Size

func (m *CodeRequest) XXX_Size() int

func (*CodeRequest) XXX_Unmarshal

func (m *CodeRequest) XXX_Unmarshal(b []byte) error

type CodeRequestValidationError

type CodeRequestValidationError struct {
	// contains filtered or unexported fields
}

CodeRequestValidationError is the validation error returned by CodeRequest.Validate if the designated constraints aren't met.

func (CodeRequestValidationError) Cause

Cause function returns cause value.

func (CodeRequestValidationError) Error

Error satisfies the builtin error interface

func (CodeRequestValidationError) ErrorName

func (e CodeRequestValidationError) ErrorName() string

ErrorName returns error name.

func (CodeRequestValidationError) Field

Field function returns field value.

func (CodeRequestValidationError) Key

Key function returns key value.

func (CodeRequestValidationError) Reason

Reason function returns reason value.

type CodeServer

type CodeServer interface {
	// Get regions.
	GetRegions(context.Context, *empty.Empty) (*Regions, error)
	// Launch verification code process.
	Apply(context.Context, *CodeRequest) (*empty.Empty, error)
}

CodeServer is the server API for Code service.

type InnerCodeClient

type InnerCodeClient interface {
	// Check the verification code.
	Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

InnerCodeClient is the client API for InnerCode service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewInnerCodeClient

func NewInnerCodeClient(cc *grpc.ClientConn) InnerCodeClient

type InnerCodeServer

type InnerCodeServer interface {
	// Check the verification code.
	Verify(context.Context, *VerifyRequest) (*empty.Empty, error)
}

InnerCodeServer is the server API for InnerCode service.

type Region

type Region struct {
	Name                 *string  `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Local                *string  `protobuf:"bytes,2,req,name=local" json:"local,omitempty"`
	Abbr                 *string  `protobuf:"bytes,3,req,name=abbr" json:"abbr,omitempty"`
	Code                 *string  `protobuf:"bytes,4,req,name=code" json:"code,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Region.

func (*Region) Descriptor

func (*Region) Descriptor() ([]byte, []int)

func (*Region) GetAbbr

func (m *Region) GetAbbr() string

func (*Region) GetCode

func (m *Region) GetCode() string

func (*Region) GetLocal

func (m *Region) GetLocal() string

func (*Region) GetName

func (m *Region) GetName() string

func (*Region) ProtoMessage

func (*Region) ProtoMessage()

func (*Region) Reset

func (m *Region) Reset()

func (*Region) String

func (m *Region) String() string

func (*Region) Validate

func (m *Region) Validate() error

Validate checks the field values on Region with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*Region) XXX_DiscardUnknown

func (m *Region) XXX_DiscardUnknown()

func (*Region) XXX_Marshal

func (m *Region) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Region) XXX_Merge

func (m *Region) XXX_Merge(src proto.Message)

func (*Region) XXX_Size

func (m *Region) XXX_Size() int

func (*Region) XXX_Unmarshal

func (m *Region) XXX_Unmarshal(b []byte) error

type RegionValidationError

type RegionValidationError struct {
	// contains filtered or unexported fields
}

RegionValidationError is the validation error returned by Region.Validate if the designated constraints aren't met.

func (RegionValidationError) Cause

func (e RegionValidationError) Cause() error

Cause function returns cause value.

func (RegionValidationError) Error

func (e RegionValidationError) Error() string

Error satisfies the builtin error interface

func (RegionValidationError) ErrorName

func (e RegionValidationError) ErrorName() string

ErrorName returns error name.

func (RegionValidationError) Field

func (e RegionValidationError) Field() string

Field function returns field value.

func (RegionValidationError) Key

func (e RegionValidationError) Key() bool

Key function returns key value.

func (RegionValidationError) Reason

func (e RegionValidationError) Reason() string

Reason function returns reason value.

type Regions

type Regions struct {
	Regions              []*Region `protobuf:"bytes,1,rep,name=regions" json:"regions,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

Regions.

func (*Regions) Descriptor

func (*Regions) Descriptor() ([]byte, []int)

func (*Regions) GetRegions

func (m *Regions) GetRegions() []*Region

func (*Regions) ProtoMessage

func (*Regions) ProtoMessage()

func (*Regions) Reset

func (m *Regions) Reset()

func (*Regions) String

func (m *Regions) String() string

func (*Regions) Validate

func (m *Regions) Validate() error

Validate checks the field values on Regions with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*Regions) XXX_DiscardUnknown

func (m *Regions) XXX_DiscardUnknown()

func (*Regions) XXX_Marshal

func (m *Regions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Regions) XXX_Merge

func (m *Regions) XXX_Merge(src proto.Message)

func (*Regions) XXX_Size

func (m *Regions) XXX_Size() int

func (*Regions) XXX_Unmarshal

func (m *Regions) XXX_Unmarshal(b []byte) error

type RegionsValidationError

type RegionsValidationError struct {
	// contains filtered or unexported fields
}

RegionsValidationError is the validation error returned by Regions.Validate if the designated constraints aren't met.

func (RegionsValidationError) Cause

func (e RegionsValidationError) Cause() error

Cause function returns cause value.

func (RegionsValidationError) Error

func (e RegionsValidationError) Error() string

Error satisfies the builtin error interface

func (RegionsValidationError) ErrorName

func (e RegionsValidationError) ErrorName() string

ErrorName returns error name.

func (RegionsValidationError) Field

func (e RegionsValidationError) Field() string

Field function returns field value.

func (RegionsValidationError) Key

func (e RegionsValidationError) Key() bool

Key function returns key value.

func (RegionsValidationError) Reason

func (e RegionsValidationError) Reason() string

Reason function returns reason value.

type UnimplementedCodeServer

type UnimplementedCodeServer struct {
}

UnimplementedCodeServer can be embedded to have forward compatible implementations.

func (*UnimplementedCodeServer) Apply

func (*UnimplementedCodeServer) GetRegions

func (*UnimplementedCodeServer) GetRegions(ctx context.Context, req *empty.Empty) (*Regions, error)

type UnimplementedInnerCodeServer

type UnimplementedInnerCodeServer struct {
}

UnimplementedInnerCodeServer can be embedded to have forward compatible implementations.

func (*UnimplementedInnerCodeServer) Verify

type VerifyRequest

type VerifyRequest struct {
	Category             *Category `protobuf:"varint,1,req,name=category,enum=appootb.captcha.Category" json:"category,omitempty"`
	Target               *string   `protobuf:"bytes,2,req,name=target" json:"target,omitempty"`
	Value                *string   `protobuf:"bytes,3,req,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

Captcha code verify request.

func (*VerifyRequest) Descriptor

func (*VerifyRequest) Descriptor() ([]byte, []int)

func (*VerifyRequest) GetCategory

func (m *VerifyRequest) GetCategory() Category

func (*VerifyRequest) GetTarget

func (m *VerifyRequest) GetTarget() string

func (*VerifyRequest) GetValue

func (m *VerifyRequest) GetValue() string

func (*VerifyRequest) ProtoMessage

func (*VerifyRequest) ProtoMessage()

func (*VerifyRequest) Reset

func (m *VerifyRequest) Reset()

func (*VerifyRequest) String

func (m *VerifyRequest) String() string

func (*VerifyRequest) Validate

func (m *VerifyRequest) Validate() error

Validate checks the field values on VerifyRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*VerifyRequest) XXX_DiscardUnknown

func (m *VerifyRequest) XXX_DiscardUnknown()

func (*VerifyRequest) XXX_Marshal

func (m *VerifyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VerifyRequest) XXX_Merge

func (m *VerifyRequest) XXX_Merge(src proto.Message)

func (*VerifyRequest) XXX_Size

func (m *VerifyRequest) XXX_Size() int

func (*VerifyRequest) XXX_Unmarshal

func (m *VerifyRequest) XXX_Unmarshal(b []byte) error

type VerifyRequestValidationError

type VerifyRequestValidationError struct {
	// contains filtered or unexported fields
}

VerifyRequestValidationError is the validation error returned by VerifyRequest.Validate if the designated constraints aren't met.

func (VerifyRequestValidationError) Cause

Cause function returns cause value.

func (VerifyRequestValidationError) Error

Error satisfies the builtin error interface

func (VerifyRequestValidationError) ErrorName

func (e VerifyRequestValidationError) ErrorName() string

ErrorName returns error name.

func (VerifyRequestValidationError) Field

Field function returns field value.

func (VerifyRequestValidationError) Key

Key function returns key value.

func (VerifyRequestValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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