Documentation ¶
Index ¶
- type Deps
- type Handler
- func (h *Handler) CheckUserSession(userId int) (bool, string)
- func (h *Handler) CheckUserToken(token string) bool
- func (h *Handler) DeleteSession(token string)
- func (h *Handler) GetActiveUsers(c *gin.Context)
- func (h *Handler) Init() *gin.Engine
- func (h *Handler) SignIn(c *gin.Context)
- func (h *Handler) SignUp(c *gin.Context)
- type Job
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Repos *repository.Repositories
}
type Handler ¶
func NewHandler ¶
func (*Handler) CheckUserToken ¶
func (*Handler) DeleteSession ¶
func (*Handler) GetActiveUsers ¶
@Summary Active users @Tags Users @Description Number of active users in a chat @Accept json @Produce json @Success 200 {string} []string "Returns all active users in the chat" @Failure 500 {string} string "Internal server error" @Router /user/active [get]
func (*Handler) SignIn ¶
@Summary Sign in @Tags Users @Description User account login @Accept json @Produce json @Param input body userInput true "Please enter your username and password to login" @Success 200 {object} models.JSONResult{data=string} "Successful server response" @Failure 400 {object} models.JSONResult{data=string} "Invalid input request" @Failure 500 {object} models.JSONResult{data=string} "Internal server error" @Router /user/login [post]
func (*Handler) SignUp ¶
@Summary Sign up @Tags Users @Description Registration a new user in the system @Accept json @Produce json @Param input body userInput true "Please enter your username and password to register" @Success 200 {object} models.JSONResult{data=string} "Successful server response" @Failure 400 {object} models.JSONResult{data=string} "Invalid input request" @Failure 500 {object} models.JSONResult{data=string} "Internal server error" @Router /user [post]