model

package
v0.0.0-...-78a9fc4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gote

type Gote struct {
	ID        int    `json:"id"`
	UserId    int    `json:"user_id"`
	Name      string `json:"name"`
	Text      string `json:"text"`
	CreatedAt int    `json:"created_at"`
	UpdatedAt int    `json:"updated_at"`
}

Gote data model

func TestGote

func TestGote(t *testing.T) *Gote

Testing Gote

func (*Gote) Validate

func (g *Gote) Validate() error

Gotes validation

type User

type User struct {
	ID           int    `json:"id"`
	Email        string `json:"email"`
	Password     string `json:"password,omitempty"`
	PasswordHash string `json:"-"`
	CreatedAt    int    `json:"created_at"`
	UpdatedAt    int    `json:"updated_at"`
}

User model

func TestUser

func TestUser(t *testing.T) *User

Testing User

func (*User) BeforeCreate

func (u *User) BeforeCreate() error

For before creating User

func (*User) ClearAttributes

func (u *User) ClearAttributes()

Clear attributes

func (*User) ComparePassword

func (u *User) ComparePassword(password string) bool

Compare password with user hased one

func (*User) Validate

func (u *User) Validate() error

User validation

Jump to

Keyboard shortcuts

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