models

package
v0.0.0-...-1d69984 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Cleanup

func Cleanup()

func Connect

func Connect()

Types

type BaseModel

type BaseModel struct {
	ID        uint           `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type User

type User struct {
	BaseModel
	Email           string     `gorm:"unique;not null" json:"email"`
	Password        string     `gorm:"not null" json:"-"`
	ActivatedAt     *time.Time `gorm:"index" json:"activated_at"`
	ActivationToken string     `gorm:"index" json:"activation_token"`
	RefreshToken    string     `gorm:"index" json:"refresh_token"`
}

func (*User) Create

func (user *User) Create() error

func (*User) Find

func (user *User) Find() error

func (*User) FindByActivationToken

func (user *User) FindByActivationToken() error

func (*User) Update

func (user *User) Update() error

Jump to

Keyboard shortcuts

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