model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAUser

func CreateAUser(user *User) (err error)

CreateAUser create a user function

Types

type User

type User struct {
	gorm.Model
	Name      string `gorm:"type:varchar(20);not null"`
	Telephone string `gorm:"type:varchar(11);not null;unique"`
	Password  string `gorm:"size:255;not null"`
}

User Model

func GetAUserById

func GetAUserById(userId uint) (user *User, err error)

GetAUserById get a user by userId

func GetAUserByTelephone

func GetAUserByTelephone(telephone string) (user *User, err error)

GetAUserByTelephone get a user by telephone

Jump to

Keyboard shortcuts

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