models

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

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataCard

type DataCard struct {
	Id     int
	Type   DataType
	UserId string
	Number string
	Meta   string
}

DataCard user data card type

func NewDataCard

func NewDataCard(number, meta string) *DataCard

NewDataCard returns a new user data card instance

func (*DataCard) ToProto

func (c *DataCard) ToProto() *pb.DataCard

type DataFile

type DataFile struct {
	FileId   uuid.UUID
	Type     DataType
	UserId   string
	FileType string
	Path     string
}

type DataText

type DataText struct {
	Id     int
	Type   DataType
	UserId string
	Text   string
	Meta   string
}

DataText user data text type

func NewDataText

func NewDataText(text, meta string) *DataText

NewDataText returns a new user data text instance

func (*DataText) ToProto

func (c *DataText) ToProto() *pb.DataText

type DataType

type DataType int32
const (
	TypeText DataType = 1 + iota
	TypeCard
	TypeFile
)

type User

type User struct {
	Id       uuid.UUID
	Name     string `db:"login"`
	Password string `db:"password"`
}

User base user struct

func NewUser

func NewUser(name, password string) (*User, error)

NewUser returns a new user

func (*User) CheckPassword

func (user *User) CheckPassword(password string) (err error)

CheckPassword check password hash

Jump to

Keyboard shortcuts

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