Documentation ¶
Overview ¶
Package handler is a generated protocol buffer package.
It is generated from these files:
service_client.proto
It has these top-level messages:
Log User SCPayload
Index ¶
- Constants
- Variables
- func ApplyCodeGeneration(log *Log, context *processor.Context, address, phoneNumber, familyName string) error
- func ApplyCreateUser(address string, user *User, context *processor.Context) error
- func ApplyUpdateUser(address string, userUpdateData *User, context *processor.Context) error
- func ApplyVerification(address string, log *Log, context *processor.Context, phoneNumber string) error
- func GetLogValidationErrors(log *Log) []string
- func GetPayloadErrors(payload *SCPayload) []string
- func GetUserValidationErrors(user *User) []string
- func Hexdigest(str string) string
- type Log
- type PayloadType
- type SCHandler
- func (self *SCHandler) Apply(request *processor_pb2.TpProcessRequest, context *processor.Context) error
- func (self *SCHandler) FamilyName() string
- func (self *SCHandler) FamilyVersions() []string
- func (self *SCHandler) GetFamilyName() string
- func (self *SCHandler) Namespaces() []string
- func (self *SCHandler) SetFamilyName(name string)
- func (self *SCHandler) SetFamilyVersion(version string)
- type SCPayload
- type User
Constants ¶
View Source
const ( RESEND_CODE = "RESEND_CODE" SEND_CODE = "SEND_CODE" EXPIRED = "EXPIRED" VALID = "VALID" INVALID = "INVALID" REJECT = "REJECT" )
Variables ¶
View Source
var ( RE = regexp.MustCompile(`^\+?[1-9]\d{1,14}$`) RE_EMAIL = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_" + "{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$") )
View Source
var PayloadType_name = map[int32]string{
0: "USER_CREATE",
1: "USER_UPDATE",
2: "CODE_GENERATE",
3: "CODE_VERIFY",
}
View Source
var PayloadType_value = map[string]int32{
"USER_CREATE": 0,
"USER_UPDATE": 1,
"CODE_GENERATE": 2,
"CODE_VERIFY": 3,
}
Functions ¶
func ApplyCodeGeneration ¶
func ApplyCreateUser ¶
func ApplyUpdateUser ¶
func ApplyVerification ¶
func GetLogValidationErrors ¶
func GetPayloadErrors ¶
func GetUserValidationErrors ¶
Types ¶
type Log ¶
type Log struct { Event string `protobuf:"bytes,1,opt" json:"Event,omitempty"` Status string `protobuf:"bytes,2,opt" json:"Status,omitempty"` Code uint32 `protobuf:"varint,3,opt" json:"Code,omitempty"` ExpiredAt float64 `protobuf:"fixed64,4,opt" json:"ExpiredAt,omitempty"` Embeded bool `protobuf:"varint,5,opt" json:"Embeded,omitempty"` ActionTime float64 `protobuf:"fixed64,6,opt" json:"ActionTime,omitempty"` Method string `protobuf:"bytes,7,opt" json:"Method,omitempty"` Cert string `protobuf:"bytes,8,opt" json:"Cert,omitempty"` }
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
type PayloadType ¶
type PayloadType int32
const ( PayloadType_USER_CREATE PayloadType = 0 PayloadType_USER_UPDATE PayloadType = 1 PayloadType_CODE_GENERATE PayloadType = 2 PayloadType_CODE_VERIFY PayloadType = 3 )
func (PayloadType) String ¶
func (x PayloadType) String() string
type SCHandler ¶
type SCHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*SCHandler) Apply ¶
func (self *SCHandler) Apply(request *processor_pb2.TpProcessRequest, context *processor.Context) error
func (*SCHandler) FamilyName ¶
func (*SCHandler) FamilyVersions ¶
func (*SCHandler) GetFamilyName ¶
func (*SCHandler) Namespaces ¶
func (*SCHandler) SetFamilyName ¶
func (*SCHandler) SetFamilyVersion ¶
type SCPayload ¶
type SCPayload struct { Action PayloadType `protobuf:"varint,1,opt,enum=PayloadType" json:"Action,omitempty"` PhoneNumber string `protobuf:"bytes,2,opt" json:"PhoneNumber,omitempty"` PayloadUser *User `protobuf:"bytes,3,opt" json:"PayloadUser,omitempty"` PayloadLog *Log `protobuf:"bytes,4,opt" json:"PayloadLog,omitempty"` }
todo: переименовать sex в gender
func (*SCPayload) GetPayloadLog ¶
func (*SCPayload) GetPayloadUser ¶
func (*SCPayload) ProtoMessage ¶
func (*SCPayload) ProtoMessage()
type User ¶
type User struct { PhoneNumber string `protobuf:"bytes,1,opt" json:"PhoneNumber,omitempty"` Uin string `protobuf:"bytes,2,opt" json:"Uin,omitempty"` Name string `protobuf:"bytes,3,opt" json:"Name,omitempty"` IsVerified bool `protobuf:"varint,4,opt" json:"IsVerified,omitempty"` Email string `protobuf:"bytes,5,opt" json:"Email,omitempty"` Sex string `protobuf:"bytes,6,opt" json:"Sex,omitempty"` Birthdate float64 `protobuf:"fixed64,7,opt" json:"Birthdate,omitempty"` AdditionalData string `protobuf:"bytes,8,opt" json:"AdditionalData,omitempty"` UpdatedAt float64 `protobuf:"fixed64,9,opt" json:"UpdatedAt,omitempty"` UpdatedBy string `protobuf:"bytes,10,opt" json:"UpdatedBy,omitempty"` Logs []*Log `protobuf:"bytes,11,rep" json:"Logs,omitempty"` }
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.