auth

package
v0.0.0-...-d4bccd0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	UserID    uint   `json:"user_id" example:"1"`
	Email     string `json:"email" example:"foo@bar.com"`
	Payload   string `json:"payload" example:"Bearer"`
	TokenType string `json:"token_type" example:"aa3f97cec3f342bc9b11e0592bbce319"`

} //@name AuthResponse

type AuthUseCase

type AuthUseCase struct {
	// contains filtered or unexported fields
}

func (*AuthUseCase) GetToken

func (au *AuthUseCase) GetToken(user entities.User) (AuthResponse, error)

func (*AuthUseCase) Login

func (au *AuthUseCase) Login(data LoginDTORequest) (AuthResponse, error)

func (*AuthUseCase) Logout

func (*AuthUseCase) Register

func (au *AuthUseCase) Register(data RegisterDTORequest) (AuthResponse, error)

type AuthUseCaseInterface

type AuthUseCaseInterface interface {
	Login(data LoginDTORequest) (AuthResponse, error)
	Register(data RegisterDTORequest) (AuthResponse, error)
	Logout(data LogoutDTORequest) (LogoutDTOResponse, error)
}

func NewAuthUseCase

func NewAuthUseCase(userService user.UserUseCaseInterface, appConfig configs.AppConfig, redisClient *redis.Client) AuthUseCaseInterface

type LoginDTORequest

type LoginDTORequest struct {
	Email    string `json:"email" example:"foo@bar.com" form:"email"`
	Password string `json:"password" example:"secret" form:"password"`

} // @name LoginRequest

type LogoutDTORequest

type LogoutDTORequest struct {
	UserID      uint   `json:"user_id" example:"1"`
	AccessToken string `json:"access_token" example:"aa3f97cec3f342bc9b11e0592bbce319"`

} //@name LogoutRequest

type LogoutDTOResponse

type LogoutDTOResponse struct {
	Status string `json:"status" example:"success"`

} //@name LogoutResponse

type RegisterDTORequest

type RegisterDTORequest struct {
	Email    string `json:"email" example:"foo@bar.com" form:"email"`
	Name     string `json:"name" example:"John Doe" form:"name"`
	Password string `json:"password" example:"secret" form:"password"`

} //@name RegisterRequest

Jump to

Keyboard shortcuts

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