entity

package
v0.0.0-...-b102962 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTokenCost = 14

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	ID         int64 `gorm:"column:id;primaryKey"`
	Title      string
	Status     string
	CreatedAt  time.Time `gorm:"autoCreateTime"`
	FinishedAt sql.NullTime
	UserID     int64 `gorm:"column:user_id;foreignKey"`
	User       User
}
func (t Task) JSONAPILinks() *jsonapi.Links
func (t Task) JSONAPIRelationshipLinks(relation string) *jsonapi.Links

type Token

type Token struct {
	ID        int64 `gorm:"column:id;primaryKey"`
	UserID    int64 `gorm:"column:user_id;foreignKey"`
	Title     string
	Token     string
	IssuedAt  time.Time `gorm:"autoCreateTime"`
	Active    int
	LastUsed  sql.NullTime
	ExpiredAt sql.NullTime
	User      User
}

func (*Token) HashToken

func (t *Token) HashToken() error

func (*Token) VerifyToken

func (t *Token) VerifyToken(rawToken string) error

type User

type User struct {
	ID        int64  `gorm:"column:id;primaryKey"`
	Email     string ` gorm:"unique"`
	Password  string
	Username  string `gorm:"unique"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Tasks     []Task
}

func (*User) CheckPassword

func (user *User) CheckPassword(rawPassword string) error

func (*User) HashPassword

func (user *User) HashPassword() error

Jump to

Keyboard shortcuts

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