models

package
v0.0.0-...-be9f245 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUser

func DeleteUser(user *User) (err error)

func GetDB

func GetDB() *gorm.DB

func GetUserForUpdateOrDelete

func GetUserForUpdateOrDelete(id int, user *User) (err error)

func UpdateUser

func UpdateUser(user *User) (err error)

Types

type User

type User struct {
	gorm.Model
	Name     string
	Username string `gorm:"type:varchar(100);unique_index"`
	Password string
}

func GetUser

func GetUser(id int) *User

func GetUsername

func GetUsername(username string) *User

func GetUsers

func GetUsers() []*User

func (*User) Create

func (user *User) Create() map[string]interface{}

func (*User) Validate

func (user *User) Validate() (map[string]interface{}, bool)

Jump to

Keyboard shortcuts

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