Documentation ¶
Index ¶
- func StartRestServer(orm *db.DbOrm, port int)
- type AddTagRequest
- type Base
- type CreateGuestRequest
- type CreateScoreRequest
- type CreateTagRequest
- type Guest
- type HTTPResponse
- type IDResponse
- type RestService
- func (t *RestService) AddTag(c *fiber.Ctx) error
- func (t *RestService) CreateGuest(c *fiber.Ctx) error
- func (t *RestService) CreateScore(c *fiber.Ctx) error
- func (t *RestService) CreateTag(c *fiber.Ctx) error
- func (t *RestService) FindGuest(c *fiber.Ctx) error
- func (t *RestService) FindScore(c *fiber.Ctx) error
- func (t *RestService) FindTag(c *fiber.Ctx) error
- func (t *RestService) SearchTags(c *fiber.Ctx) error
- func (t *RestService) UseScore(c *fiber.Ctx) error
- type Score
- type SearchTagsRequest
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartRestServer ¶
@securityDefinitions.apikey ApiKeyAuth @in header @name Authorization
Types ¶
type AddTagRequest ¶
type AddTagRequest struct {
TagID string `json:"tag_id"`
}
type CreateGuestRequest ¶
type CreateScoreRequest ¶
type CreateTagRequest ¶
type CreateTagRequest struct {
Name string `json:"name"`
}
type Guest ¶
type Guest struct { Base `json:",inline"` CreateGuestRequest `json:",inline"` }
type HTTPResponse ¶
type HTTPResponse struct {
Msg string `json:"msg,omitempty" example:"any message"`
}
type IDResponse ¶
type IDResponse struct {
ID string `json:"id"`
}
type RestService ¶
func NewRestService ¶
func NewRestService(service *service.Service) *RestService
func (*RestService) AddTag ¶
func (t *RestService) AddTag(c *fiber.Ctx) error
AddTag godoc @Summary add a tag to a score @ID addTag @Tags Score @Description Router for add a tag to a score @Accept json @Produce json @Param score_id path string true "Score ID" @Param body body AddTagRequest true "JSON body for add a tag to a score" @Success 200 {object} HTTPResponse @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /scores/{score_id}/tags [post]
func (*RestService) CreateGuest ¶
func (t *RestService) CreateGuest(c *fiber.Ctx) error
CreateGuest godoc @Summary create a new guest @ID createGuest @Tags Guest @Description Router for create a new guest @Accept json @Produce json @Param body body CreateGuestRequest true "JSON body for create a new guest" @Success 200 {object} IDResponse @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /guests [post]
func (*RestService) CreateScore ¶
func (t *RestService) CreateScore(c *fiber.Ctx) error
CreateScore godoc @Summary create a new score @ID createScore @Tags Score @Description Router for create a new score @Accept json @Produce json @Param body body CreateScoreRequest true "JSON body for create a new score" @Success 200 {object} IDResponse @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /scores [post]
func (*RestService) CreateTag ¶
func (t *RestService) CreateTag(c *fiber.Ctx) error
CreateTag godoc @Summary create a new tag @ID createTag @Tags Tag @Description Router for create a new tag @Accept json @Produce json @Param body body CreateTagRequest true "JSON body for create a new tag" @Success 200 {object} IDResponse @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /tags [post]
func (*RestService) FindGuest ¶
func (t *RestService) FindGuest(c *fiber.Ctx) error
FindGuest godoc @Summary find a guest @ID findGuest @Tags Guest @Description Router for find a guest @Accept json @Produce json @Param guest_id path string true "Guest ID" @Success 200 {object} Guest @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /guests/{guest_id} [get]
func (*RestService) FindScore ¶
func (t *RestService) FindScore(c *fiber.Ctx) error
FindScore godoc @Summary find a score @ID findScore @Tags Score @Description Router for find a score @Accept json @Produce json @Param score_id path string true "Score ID" @Success 200 {object} Score @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /scores/{score_id} [get]
func (*RestService) FindTag ¶
func (t *RestService) FindTag(c *fiber.Ctx) error
FindTag godoc @Summary find a tag @ID findTag @Tags Tag @Description Router for find a tag @Accept json @Produce json @Param tag_id path string true "Tag ID" @Success 200 {object} Tag @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /tags/{tag_id} [get]
func (*RestService) SearchTags ¶
func (t *RestService) SearchTags(c *fiber.Ctx) error
SearchTags godoc @Summary search tags @ID searchTags @Tags Tag @Description Router for search tags @Accept json @Produce json @Param q query SearchTagsRequest false "query for search tags" @Success 200 {array} Tag @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /tags [get]
func (*RestService) UseScore ¶
func (t *RestService) UseScore(c *fiber.Ctx) error
UseScore godoc @Summary use a score @ID useScore @Tags Score @Description Router for use a score @Accept json @Produce json @Param score_id path string true "Score ID" @Success 200 {object} HTTPResponse @Failure 400 {object} HTTPResponse @Failure 403 {object} HTTPResponse @Router /scores/{score_id}/use [post]
type SearchTagsRequest ¶
type SearchTagsRequest struct {
Name string `query:"name"`
}
type Tag ¶
type Tag struct { Base `json:",inline"` CreateTagRequest `json:",inline"` }