user

package
v0.0.0-...-242d932 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) ([]byte, error)

func VerifyPassword

func VerifyPassword(hashedPassword string, userPassword string) error

Types

type Model

type Model struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	UserName  string             `bson:"userName,omitempty" json:"userName"`
	Email     string             `bson:"email,omitempty" json:"email"`
	Password  string             `bson:"password,omitempty" json:"password"`
	CreatedAt int64              `bson:"createdAt" json:"createdAt"`
}

func (*Model) Create

func (user *Model) Create() *errors.ApplicationError

func (*Model) Delete

func (user *Model) Delete() *errors.ApplicationError

func (*Model) FindByEmail

func (user *Model) FindByEmail() (*Model, *errors.ApplicationError)

func (*Model) FindByName

func (user *Model) FindByName() (*Model, *errors.ApplicationError)

func (*Model) FindByUserID

func (user *Model) FindByUserID() (*Model, *errors.ApplicationError)

func (*Model) Update

func (user *Model) Update() (*Model, *errors.ApplicationError)

func (*Model) UserResponse

func (user *Model) UserResponse() interface{}

func (*Model) Validate

func (user *Model) Validate() *errors.ApplicationError

type Request

type Request struct {
	UserName string `json:"userName"`
	Password string `json:"password"`
}

type Response

type Response struct {
	UserName string `json:"userName"`
	Email    string `json:"email"`
}

Jump to

Keyboard shortcuts

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