Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(conf *config.APIConfig, svc AuthService) *AuthHandler
func (*AuthHandler) HandleLogin ¶
func (h *AuthHandler) HandleLogin(w http.ResponseWriter, r *http.Request)
HandleLogin godoc @Summary Login a user @Tags auth @Produce json @Param request body request.LoginRequest true "request body" @Success 200 {object} domain.User @Failure 401 {object} response.Err @Failure 500 {object} response.Err @Router /auth/login [post]
func (*AuthHandler) HandleSignup ¶
func (h *AuthHandler) HandleSignup(w http.ResponseWriter, r *http.Request)
HandleSignup godoc @Summary Signup a new user @Tags auth @Produce json @Param request body request.SignupRequest true "request body" @Success 201 {object} domain.User @Failure 400 {object} response.Err @Failure 500 {object} response.Err @Router /auth/signup [post]
type AuthService ¶
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶
func NewUserHandler(svc UserService) *UserHandler
func (*UserHandler) HandleGetUser ¶
func (h *UserHandler) HandleGetUser(w http.ResponseWriter, r *http.Request)
HandleGetUser godoc @Summary Get a user @Tags users @Produce json @Param userID path int true "user ID" @Success 200 {object} domain.User @Failure 401 {object} response.Err @Failure 500 {object} response.Err @Router /users/{userID} [get]