handler

package
v0.0.0-...-0fe63ac Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 13 Imported by: 0

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

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 ApplyCodeGeneration(
	log *Log,
	context *processor.Context,
	address, phoneNumber, familyName string) error

func ApplyCreateUser

func ApplyCreateUser(address string, user *User, context *processor.Context) error

func ApplyUpdateUser

func ApplyUpdateUser(address string, userUpdateData *User, context *processor.Context) error

func ApplyVerification

func ApplyVerification(address string, log *Log, context *processor.Context, phoneNumber string) error

func GetLogValidationErrors

func GetLogValidationErrors(log *Log) []string

func GetPayloadErrors

func GetPayloadErrors(payload *SCPayload) []string

func GetUserValidationErrors

func GetUserValidationErrors(user *User) []string

func Hexdigest

func Hexdigest(str string) string

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

func (*Log) Reset

func (m *Log) Reset()

func (*Log) String

func (m *Log) String() string

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 NewHandler(namespace string) *SCHandler

func (*SCHandler) Apply

func (self *SCHandler) Apply(request *processor_pb2.TpProcessRequest, context *processor.Context) error

func (*SCHandler) FamilyName

func (self *SCHandler) FamilyName() string

func (*SCHandler) FamilyVersions

func (self *SCHandler) FamilyVersions() []string

func (*SCHandler) GetFamilyName

func (self *SCHandler) GetFamilyName() string

func (*SCHandler) Namespaces

func (self *SCHandler) Namespaces() []string

func (*SCHandler) SetFamilyName

func (self *SCHandler) SetFamilyName(name string)

func (*SCHandler) SetFamilyVersion

func (self *SCHandler) SetFamilyVersion(version string)

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 (m *SCPayload) GetPayloadLog() *Log

func (*SCPayload) GetPayloadUser

func (m *SCPayload) GetPayloadUser() *User

func (*SCPayload) ProtoMessage

func (*SCPayload) ProtoMessage()

func (*SCPayload) Reset

func (m *SCPayload) Reset()

func (*SCPayload) String

func (m *SCPayload) String() string

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

func (m *User) GetLogs() []*Log

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

Jump to

Keyboard shortcuts

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