handler

package
v0.0.0-...-b70bbfa Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler имплементация сервиса сессий.

func New

func New(ctrl sessionController) *Handler

New создает новый Handler.

func (*Handler) Delete

func (h *Handler) Delete(c *fiber.Ctx) error

Delete godoc @Summary Удалить сессию @Description Удалить сессию по ID @Tags session @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "UUID сессии" @Success 204 {object} string "Сессия удалена" @Failure 400 {object} string "Неверное значение ID" @Failure 404 {object} string "Сессия с таким ID не найдена" @Router /session/{id} [delete]

func (*Handler) FindOne

func (h *Handler) FindOne(c *fiber.Ctx) error

FindOne godoc @Summary Получить данные о сессии @Description Получить все запросы и ответы для сессии по ID @Tags session @Accept json @Produce json @Security ApiKeyAuth @Param id path string true "UUID сессии" @Success 200 {object} model.FindOneResp "Информация о сессии" @Failure 400 {object} string "Неверное значение ID" @Router /session/{id} [get]

func (*Handler) List

func (h *Handler) List(c *fiber.Ctx) error

List godoc @Summary Список сессий @Description Получить список сессий в порядке убывания момента создания от последней к первой для авторизованного пользователя @Tags session @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} model.ListResp "Список сессий" @Router /session/list [get]

func (*Handler) NewSession

func (h *Handler) NewSession(c *fiber.Ctx) error

NewSession godoc @Summary Новая сессия @Description Создать новую сессию в чате для авторизованного пользователя @Tags session @Accept json @Produce json @Security ApiKeyAuth @Success 201 {object} model.NewSessionResp "ID новой сессии" @Failure 400 {object} string "Сессия с таким ID уже существует" @Router /session/new [post]

func (*Handler) Rename

func (h *Handler) Rename(c *fiber.Ctx) error

Rename godoc @Summary Обновить заголовок @Description Обновить заголовок сессии, который отображается в интерфейсе @Tags session @Accept json @Produce json @Security ApiKeyAuth @Param req body model.RenameReq true "ID и новое название сессии" @Success 204 {object} string "Сессия переименована" @Failure 400 {object} string "Сессия с таким ID уже существует" @Failure 404 {object} string "Сессия с таким ID не найдена" @Router /session/rename [put]

Jump to

Keyboard shortcuts

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