users

package
v0.0.0-...-dd2dae2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive = "active"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" sql:"not null;unique"`
	Password string `json:"password"`
}

LoginRequest struct

type User

type User struct {
	ID        int64          `json:"id"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`
	DeletedAt gorm.DeletedAt `json:"deletedAt"`
	Status    string         `json:"status"`
	FirstName string         `json:"firstName"`
	LastName  string         `json:"lastName"`
	Email     string         `json:"email" sql:"not null;unique"`
	Password  string         `gorm:"type:varchar(255); not null" json:"password,omitempty"`
}

User dto

func (*User) Delete

func (user *User) Delete() *errors.RestError

Delete User in db

func (*User) FindByEmail

func (user *User) FindByEmail() *errors.RestError

FindByEmail find user by email

func (*User) Get

func (user *User) Get() *errors.RestError

Get user by id from db

func (*User) GetAll

func (user *User) GetAll() ([]*User, *errors.RestError)

GetAll users

func (*User) Save

func (user *User) Save() *errors.RestError

Save a user to db

func (*User) Update

func (user *User) Update() *errors.RestError

Update a user in the db

func (*User) Validate

func (user *User) Validate() *errors.RestError

Validate user struct

Jump to

Keyboard shortcuts

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