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: 11 Imported by: 0

Documentation

Overview

Package handler is a generated protocol buffer package.

It is generated from these files:

service.proto

It has these top-level messages:

User
SCPayload

Index

Constants

View Source
const (
	NAME    = "tfa"
	VERSION = "0.1"
)

Variables

View Source
var PayloadType_name = map[int32]string{
	0: "USER_CREATE",
	1: "USER_UPDATE",
}
View Source
var PayloadType_value = map[string]int32{
	"USER_CREATE": 0,
	"USER_UPDATE": 1,
}
View Source
var RE = regexp.MustCompile(`^\+?[1-9]\d{1,14}$`)
View Source
var 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])?)*$")

Functions

func ApplyCreate

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

func ApplyUpdate

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

func GetUserValidationErrors

func GetUserValidationErrors(user *User) []string

func Hexdigest

func Hexdigest(str string) string

Types

type PayloadType

type PayloadType int32
const (
	PayloadType_USER_CREATE PayloadType = 0
	PayloadType_USER_UPDATE PayloadType = 1
)

func (PayloadType) EnumDescriptor

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

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

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

type SCPayload

type SCPayload struct {
	Action      PayloadType `protobuf:"varint,1,opt,name=Action,enum=PayloadType" json:"Action,omitempty"`
	PhoneNumber string      `protobuf:"bytes,2,opt,name=PhoneNumber" json:"PhoneNumber,omitempty"`
	PayloadUser *User       `protobuf:"bytes,3,opt,name=PayloadUser" json:"PayloadUser,omitempty"`
}

todo: rename SCPayload to SPayload before todo: next protocol buffer update todo: переименовать sex в gender

func (*SCPayload) Descriptor

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

func (*SCPayload) GetAction

func (m *SCPayload) GetAction() PayloadType

func (*SCPayload) GetPayloadUser

func (m *SCPayload) GetPayloadUser() *User

func (*SCPayload) GetPhoneNumber

func (m *SCPayload) GetPhoneNumber() string

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,name=PhoneNumber" json:"PhoneNumber,omitempty"`
	Uin         string  `protobuf:"bytes,2,opt,name=Uin" json:"Uin,omitempty"`
	Name        string  `protobuf:"bytes,3,opt,name=Name" json:"Name,omitempty"`
	IsVerified  bool    `protobuf:"varint,4,opt,name=IsVerified" json:"IsVerified,omitempty"`
	Email       string  `protobuf:"bytes,5,opt,name=Email" json:"Email,omitempty"`
	Sex         string  `protobuf:"bytes,6,opt,name=Sex" json:"Sex,omitempty"`
	Birthdate   float64 `protobuf:"fixed64,7,opt,name=Birthdate" json:"Birthdate,omitempty"`
	PushToken   string  `protobuf:"bytes,8,opt,name=PushToken" json:"PushToken,omitempty"`
}

func (*User) Descriptor

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

func (*User) GetBirthdate

func (m *User) GetBirthdate() float64

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetIsVerified

func (m *User) GetIsVerified() bool

func (*User) GetName

func (m *User) GetName() string

func (*User) GetPhoneNumber

func (m *User) GetPhoneNumber() string

func (*User) GetPushToken

func (m *User) GetPushToken() string

func (*User) GetSex

func (m *User) GetSex() string

func (*User) GetUin

func (m *User) GetUin() string

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