models

package
v0.0.0-...-aacfc5d Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	gorm.Model
	Identifier string `gorm:"uniqueIndex;default:null"`
	UserID     uint
}

type Resource

type Resource struct {
	gorm.Model
	Redirect string `gorm:"default:null" json:"redirect"`
	UserID   uint
}

type User

type User struct {
	gorm.Model
	Name       string `gorm:"default:null" form:"name"`
	Email      string `gorm:"unique;" form:"email" binding:"required"`
	Password   string `form:"password"`
	Resources  []Resource
	Identities []Identity
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) (err error)

func (*User) Create

func (u *User) Create()

func (*User) Exist

func (u *User) Exist() bool

Exist checks and returns if a user with email already exist or not.

Jump to

Keyboard shortcuts

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