model

package
v0.0.0-...-81b12a4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

UserRoleLUT ...

Functions

This section is empty.

Types

type Session

type Session struct {
	gorm.Model
	Token     string    `gorm:"column:token; not null" json:"token"`
	ExpiredAt time.Time `gorm:"column:expired_at; not null" json:"expired_at"`
	Username  string    `gorm:"column:username; not null" json:"username"`
}

Session ...

func (Session) TableName

func (Session) TableName() string

type User

type User struct {
	gorm.Model
	Username     string   `gorm:"column:username; not null"`
	Role         UserRole `gorm:"column:role; not null"`
	PasswordHash string   `gorm:"column:password; not null"`
}

User ...

func (User) TableName

func (User) TableName() string

type UserRole

type UserRole string

UserRole ...

const (
	RoleAdmin UserRole = "administrator"
	RoleUser  UserRole = "user"
)

Jump to

Keyboard shortcuts

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