Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrorUserExists = "user exists" ErrorWrongCredentials = "wrong credentials" )
Variables ¶
This section is empty.
Functions ¶
func NewAuthHandler ¶
func NewAuthHandler(router *http.ServeMux, deps AuthHandlerDeps)
Types ¶
type AuthHandler ¶
type AuthHandler struct { *configs.Config *AuthService }
func (*AuthHandler) Login ¶
func (handler *AuthHandler) Login() http.HandlerFunc
func (*AuthHandler) Register ¶
func (handler *AuthHandler) Register() http.HandlerFunc
type AuthHandlerDeps ¶
type AuthHandlerDeps struct { *configs.Config *AuthService }
type AuthService ¶
type AuthService struct {
UserRepository di.IUserRepository
}
func NewAuthService ¶
func NewAuthService(userRepository di.IUserRepository) *AuthService
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
type RegisterRequest ¶
type RegisterResponse ¶
type RegisterResponse struct {
Token string `json:"token"`
}
Click to show internal directories.
Click to hide internal directories.