user

package
v0.0.0-...-cba5bb6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Zlib Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(db *gorm.DB, user string) bool

Types

type PaymentHistory

type PaymentHistory struct {
	ID        uint64    `gorm:"primary_key" json:"-"`
	UserID    uint64    `gorm:"type:bigint not null REFERENCES users(id)" json:"-"`
	IPN       string    `gorm:"not null;type:text" json:"-"`
	IPNRAW    string    `gorm:"not null;type:text" json:"-"`
	UpdatedAt time.Time `json:"-"`
	CreatedAt time.Time `json:"-"`
}

type User

type User struct {
	ID                    uint64     `gorm:"primary_key" json:"-"`
	PaymentID             string     `gorm:"not null" json:"-"`
	Email                 string     `gorm:"not null;unique" json:"-"`
	EmailVerified         *time.Time `json:"-"`
	StartedSubscription   *time.Time `json:"-"`
	CancelledSubscription *time.Time `json:"-"`
	Quota                 uint64     `gorm:"not null;default:10737418240" json:"quota"`
	QuotaInode            uint64     `gorm:"not null;default:1000" json:"quota_inode"`
	HashedPassword        string     `gorm:"not null" json:"-"`
	CreatedAt             time.Time  `json:"-"`
	UpdatedAt             time.Time  `json:"-"`
}

func FindUser

func FindUser(db *gorm.DB, user string, pass string) (*User, error)

func (*User) BeforeCreate

func (user *User) BeforeCreate(scope *gorm.Scope) error
func (user *User) GenerateVerificationLink() *VerificationLink

func (*User) MatchPassword

func (user *User) MatchPassword(p string) bool

func (*User) Paid

func (user *User) Paid() bool

func (*User) SetPassword

func (user *User) SetPassword(p string)
type VerificationLink struct {
	ID         string     `gorm:"primary_key" json:"-"`
	UserID     uint64     `gorm:"type:bigint not null REFERENCES users(id)" json:"-"`
	Email      string     `gorm:"type:varchar(255) not null" json:"-"`
	VerifiedAt *time.Time `gorm:"null" json:"-"`
	SentAt     uint64     `gorm:"not null" json:"-"`
	UpdatedAt  time.Time  `json:"-"`
	CreatedAt  time.Time  `json:"-"`
}

Jump to

Keyboard shortcuts

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