models

package
v0.0.0-...-7aa25ca Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func InitDB

func InitDB()

Types

type User

type User struct {
	gorm.Model
	Name    string `gorm:"type:varchar(100)" json:"name"`
	Age     int64  `gorm:"type:bigint(20)" json:"age"`
	Email   string `gorm:"type:varchar(100);unique_index" json:"email"`
	Address string `gorm:"index:addr" json:"address"`
}

func (User) AddUser

func (user User) AddUser() error

func (User) DeleteUser

func (user User) DeleteUser(id int64) error

func (User) GetUser

func (user User) GetUser(id int64) (User, error)

func (User) ListUsers

func (user User) ListUsers() ([]User, error)

func (User) UpdateUser

func (user User) UpdateUser(id int64) error

func (User) Validate

func (user User) Validate(v *revel.Validation)

Jump to

Keyboard shortcuts

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