signup

package
v0.0.0-...-08e0700 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignupRequest

type SignupRequest struct {
	ID       primitive.ObjectID `bson:"_id" json:"_id"`
	Username string             `bson:"username" json:"username"`
	Email    string             `bson:"email" json:"email"`
	Password string             `bson:"password" json:"password"`
	Role     string             `bson:"role" json:"role"`
}

func NewUser

func NewUser(firstName string, lastName string, username string, email string, hashedPassword string, role string) (*SignupRequest, error)

func (*SignupRequest) IsCorrectPassword

func (s *SignupRequest) IsCorrectPassword(password string) bool

Compares hashedpassword from db to provided password

func (*SignupRequest) RequiredFields

func (s *SignupRequest) RequiredFields() error

RequiredFields checks that the required field are not empty

func (*SignupRequest) Validate

func (s *SignupRequest) Validate() error

Jump to

Keyboard shortcuts

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