loginController

package
v0.0.0-...-0673085 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoginService

func NewLoginService(repository Repository) *service

Types

type LoginInput

type LoginInput struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=8"`
}

type Repository

type Repository interface {
	LoginRepository(user *model.User) (*model.User, error)
	UpdateRememberTokenRepository(userID primitive.ObjectID, token string) error
}

func NewLoginRepository

func NewLoginRepository(db *mongo.Database) Repository

type Service

type Service interface {
	LoginService(input *LoginInput) (*model.User, error)
	UpdateRememberTokenService(userID primitive.ObjectID, token string) error
}

type UserLoginError

type UserLoginError struct {
	*util.BaseError
}

func (*UserLoginError) Error

func (e *UserLoginError) Error() string

type UserLoginNotFoundError

type UserLoginNotFoundError struct {
	*util.BaseError
}

func (*UserLoginNotFoundError) Error

func (e *UserLoginNotFoundError) Error() string

Jump to

Keyboard shortcuts

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