service

package
v0.0.0-...-4aa8526 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPassword = errors.New("Invalid password provided")
)

Functions

This section is empty.

Types

type LoginInput

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

func (LoginInput) Validate

func (i LoginInput) Validate() []*validator.ValidationError

type LoginService

type LoginService interface {
	Execute(input LoginInput) (*token.AccessToken, *token.RefreshToken, error)
}

func NewLoginService

func NewLoginService(db database.Database) LoginService

type LogoutService

type LogoutService interface {
	Execute(refreshToken string) error
}

func NewLogoutService

func NewLogoutService(cache cache.Cache) LogoutService

type MeService

type MeService interface {
	Execute(accessToken string) (*entity.User, error)
}

func NewMeService

func NewMeService(db database.Database) MeService

type TokenService

type TokenService interface {
	Execute(refreshToken string) (*token.AccessToken, error)
}

func NewTokenService

func NewTokenService(db database.Database, cache cache.Cache) TokenService

Jump to

Keyboard shortcuts

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