user

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	CreateUser(User) (*User, *response.BaseResponse)
	Get(User) (*User, *response.BaseResponse)
	Update(User) (*User, *response.BaseResponse)
	ResetPassword(string) *response.BaseResponse
}

type Service

type Service interface {
	CreateUser(User) (*User, *response.BaseResponse)
	Get(User) (*User, *response.BaseResponse)
	Update(User) (*User, *response.BaseResponse)
	ResetPassword(string) *response.BaseResponse
}

func NewUserService

func NewUserService(repository Repository) Service

type User

type User struct {
	Id             primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	FirstName      string             `json:"first_name" bson:"first_name"`
	LastName       string             `json:"last_name" bson:"last_name"`
	Email          string             `json:"email" bson:"email"`
	ProfilePicture string             `json:"profile_picture" bson:"profile_picture"`
	Password       string             `json:"password" bson:"password"`
	Token          string             `json:"token" bson:"token"`
	RefreshToken   string             `json:"refresh_token" bson:"refresh_token"`
}

func (*User) IsValidPassword

func (user *User) IsValidPassword(password string) *response.BaseResponse

func (*User) ValidateUserCreation

func (user *User) ValidateUserCreation() *response.BaseResponse

func (*User) ValidateUserLogin

func (user *User) ValidateUserLogin() *response.BaseResponse

Jump to

Keyboard shortcuts

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