user

package
v0.0.0-...-4805206 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID        string    `json:"id,omitempty" bson:"_id,omitempty"`
	Email     string    `json:"email" binding:"required" validate:"required" bson:"email"`
	UserName  string    `json:"userName" binding:"required" validate:"required" bson:"user_name"`
	CountryId string    `json:"countryId" binding:"required" validate:"required" bson:"country_id"`
	Password  string    `json:"password" binding:"required" validate:"required" bson:"password"`
	CreatedAt time.Time `json:"createdAt" bson:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updatedAt" bson:"updated_at,omitempty"`
	DeletedAt time.Time `json:"deletedAt" bson:"deleted_at,omitempty"`
}

func NewUser

func NewUser(email, userName, countryId, password string) *User

func (*User) HashPassword

func (u *User) HashPassword() (string, error)

func (*User) PasswordMatch

func (u *User) PasswordMatch(password string) error

type UserRepository

type UserRepository interface {
	InsertUser(ctx context.Context, user User) (err error)
	FindUserById(ctx context.Context, id string) (user *User, err error)
	FindUserByEmail(ctx context.Context, email string) (user *User, err error)
	UpdateUser(ctx context.Context, user User) (err error)
	DeleteUser(ctx context.Context, id string) (err error)
}

Directories

Path Synopsis
drivers

Jump to

Keyboard shortcuts

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