model

package
v0.0.0-...-fb6abac Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(db *pg.DB) error

func DeleteUserByPrimaryKey

func DeleteUserByPrimaryKey(pg *pg.DB, user User) (orm.Result, error)

func DropTables

func DropTables(db *pg.DB) error

func ExistsUserByPrimaryKey

func ExistsUserByPrimaryKey(pg *pg.DB, user User) (bool, error)

func InsertUser

func InsertUser(pg *pg.DB, user User) (orm.Result, error)

func InsertUserBatch

func InsertUserBatch(pg *pg.DB, users []User) (orm.Result, error)

func UpdateUserByPrimaryKey

func UpdateUserByPrimaryKey(pg *pg.DB, user User) (orm.Result, error)

Types

type LoginParams

type LoginParams struct {
	Email    string `json:"email" xml:"email" form:"email"`
	Password string `json:"password xml:"password" form:"password"`
}

type RegisterParams

type RegisterParams struct {
	Email     string `json:"email" xml:"email" form:"email" validate:"required,email"`
	FirstName string `json:"first_name" xml:"first_name" form:"first_name"`
	LastName  string `json:"last_name" xml:"last_name" form:"last_name"`
	Password  string `json:"password" xml:"password" form:"password" validate:"required"`
}

type ReturnParams

type ReturnParams struct {
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func GetReturnParams

func GetReturnParams(status string, message string, data interface{}) ReturnParams

type User

type User struct {
	Id       string `pg:"user_id"`
	Name     string `pg:"user_name"`
	Email    string `pg:"email,pk"`
	Password string `pg:"password"`
	// contains filtered or unexported fields
}

func SelectUserByPrimaryKey

func SelectUserByPrimaryKey(pg *pg.DB, user User) (User, error)

func (User) String

func (u User) String() string

Jump to

Keyboard shortcuts

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