model

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserStatusActive  = "active"
	UserStatusPending = "pending"
	UserStatusBlocked = "blocked"
)

User property types

View Source
const TableUser = "users"

TableUser Table name

Variables

Functions

This section is empty.

Types

type User

type User struct {
	// Table meta data
	MetaData mb.MetaData `db:"-" model:"table:users"`

	// Table fields
	ID           int            `db:"id" model:"name:id; type:serial,primary"`
	Email        string         `db:"email" model:"name:email"`
	Password     string         `db:"password" model:"name:password"`
	Fullname     string         `db:"fullname" model:"name:fullname"`
	Phone        string         `db:"phone" model:"name:phone"`
	Token        sql.NullString `db:"token" model:"name:token"`
	Status       string         `db:"status" model:"name:status"`
	Avatar       sql.NullString `db:"avatar" model:"name:avatar"`
	CreatedAt    time.Time      `db:"created_at" model:"name:created_at"`
	UpdatedAt    time.Time      `db:"updated_at" model:"name:updated_at"`
	VerifiedAt   sql.NullTime   `db:"verified_at" model:"name:verified_at"`
	BlockedAt    sql.NullTime   `db:"blocked_at" model:"name:blocked_at"`
	DeletedAt    sql.NullTime   `db:"deleted_at" model:"name:deleted_at"`
	LastAccessAt sql.NullTime   `db:"last_access_at" model:"name:last_access_at"`
}

User struct to describe a user object.

func (*User) IsActive

func (u *User) IsActive() bool

func (*User) IsBlocked

func (u *User) IsBlocked() bool

func (*User) IsPending

func (u *User) IsPending() bool

Jump to

Keyboard shortcuts

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