Documentation ¶
Index ¶
- func CreateTag(db *gorm.DB, tag models.Tag) (*models.Tag, *errors.Error)
- func DeleteTag(db *gorm.DB, tagID uuid.UUID) *errors.Error
- func GetTagClubs(db *gorm.DB, id uuid.UUID) ([]models.Club, *errors.Error)
- func GetTags(db *gorm.DB) ([]models.Tag, *errors.Error)
- func Tag(tagParams types.RouteParams)
- func UpdateTag(db *gorm.DB, id uuid.UUID, tag models.Tag) (*models.Tag, *errors.Error)
- type TagController
- type TagService
- func (t *TagService) CreateTag(tagBody models.CreateTagRequestBody) (*models.Tag, *errors.Error)
- func (t *TagService) DeleteTag(tagID string) *errors.Error
- func (t *TagService) GetTag(tagID string) (*models.Tag, *errors.Error)
- func (t *TagService) GetTags() ([]models.Tag, *errors.Error)
- func (t *TagService) UpdateTag(tagID string, tagBody models.UpdateTagRequestBody) (*models.Tag, *errors.Error)
- type TagServiceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTagClubs ¶
Get clubs for a tag
func Tag ¶
func Tag(tagParams types.RouteParams)
Types ¶
type TagController ¶
type TagController struct {
// contains filtered or unexported fields
}
func NewTagController ¶
func NewTagController(tagService TagServiceInterface) *TagController
func (*TagController) CreateTag ¶
func (t *TagController) CreateTag(c *fiber.Ctx) error
CreateTag godoc
@Summary Create a tag @Description Creates a tag @ID create-tag @Tags tag @Accept json @Produce json @Param tagBody body models.CreateTagRequestBody true "Tag Body" @Success 201 {object} models.Tag @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /tags/ [post]
func (*TagController) DeleteTag ¶
func (t *TagController) DeleteTag(c *fiber.Ctx) error
DeleteTag godoc
@Summary Delete a tag @Description Deletes a tag @ID delete-tag @Tags tag @Produce json @Param tagID path string true "Tag ID" @Success 204 {string} utilities.SuccessResponse @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /tags/{tagID}/ [delete]
func (*TagController) GetTag ¶
func (t *TagController) GetTag(c *fiber.Ctx) error
GetTag godoc
@Summary Retrieve a tag @Description Retrieves a tag @ID get-tag @Tags tag @Produce json @Param tagID path string true "Tag ID" @Success 200 {object} models.Tag @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /tags/{tagID}/ [get]
func (*TagController) GetTags ¶
func (t *TagController) GetTags(c *fiber.Ctx) error
GetTags godoc
@Summary Retrieve all tags @Description Retrieves all tags @ID get-all-tags @Tags tag @Produce json @Param limit query int false "Limit" @Param page query int false "Page" @Success 200 {object} []models.Tag @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /tags [get]
func (*TagController) UpdateTag ¶
func (t *TagController) UpdateTag(c *fiber.Ctx) error
UpdateTag godoc
@Summary Update a tag @Description Updates a tag @ID update-tag @Tags tag @Accept json @Produce json @Param tagID path string true "Tag ID" @Param tag body models.UpdateTagRequestBody true "Tag" @Success 200 {object} models.Tag @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /tags/{tagID}/ [patch]
type TagService ¶
type TagService struct {
types.ServiceParams
}
func (*TagService) CreateTag ¶
func (t *TagService) CreateTag(tagBody models.CreateTagRequestBody) (*models.Tag, *errors.Error)
func (*TagService) UpdateTag ¶
func (t *TagService) UpdateTag(tagID string, tagBody models.UpdateTagRequestBody) (*models.Tag, *errors.Error)
type TagServiceInterface ¶
type TagServiceInterface interface { GetTags() ([]models.Tag, *errors.Error) CreateTag(tagBody models.CreateTagRequestBody) (*models.Tag, *errors.Error) GetTag(id string) (*models.Tag, *errors.Error) UpdateTag(id string, tagBody models.UpdateTagRequestBody) (*models.Tag, *errors.Error) DeleteTag(id string) *errors.Error }
func NewTagService ¶
func NewTagService(serviceParams types.ServiceParams) TagServiceInterface