models

package
v0.0.0-...-95bb65c Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: ISC Imports: 2 Imported by: 0

Documentation

Overview

Package models defines all the database models for the application

Index

Constants

View Source
const (
	TokenUserActivation string = "user_activation"
	TokenPasswordReset  string = "password_reset"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	gorm.Model
	Identifier string
	UserID     uint
	ExpiresAt  time.Time
}

func (Session) HasExpired

func (s Session) HasExpired() bool

type Token

type Token struct {
	gorm.Model
	Value     string
	Type      string
	ModelID   int
	ModelType string
	ExpiresAt time.Time
}

func (Token) HasExpired

func (t Token) HasExpired() bool

type User

type User struct {
	gorm.Model
	Email       string
	Password    string
	ActivatedAt *time.Time
	Tokens      []Token `gorm:"polymorphic:Model;"`
	Sessions    []Session
}

type Website

type Website struct {
	gorm.Model
	Title       string
	Description string
	URL         string
}

Jump to

Keyboard shortcuts

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