api

package
v0.0.0-...-b3fea43 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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

type Handler struct {
	Sessions map[string]int
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(services *services.Services) *Handler

func (*Handler) CheckUserSession

func (h *Handler) CheckUserSession(userId int) (bool, string)

func (*Handler) CheckUserToken

func (h *Handler) CheckUserToken(token string) bool

func (*Handler) DeleteSession

func (h *Handler) DeleteSession(token string)

func (*Handler) GetActiveUsers

func (h *Handler) GetActiveUsers(c *gin.Context)

@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) Init

func (h *Handler) Init() *gin.Engine

func (*Handler) SignIn

func (h *Handler) SignIn(c *gin.Context)

@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

func (h *Handler) SignUp(c *gin.Context)

@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]

type Job

type Job struct {
	ID        int
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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