Documentation ¶
Index ¶
- Variables
- func DeleteMyPackByID(c *gin.Context)
- func DeleteMyPackContentByID(c *gin.Context)
- func DeletePackByID(c *gin.Context)
- func DeletePackContentByID(c *gin.Context)
- func GetMyPackByID(c *gin.Context)
- func GetMyPackContentsByPackID(c *gin.Context)
- func GetMyPacks(c *gin.Context)
- func GetPackByID(c *gin.Context)
- func GetPackContentByID(c *gin.Context)
- func GetPackContents(c *gin.Context)
- func GetPackContentsByPackID(c *gin.Context)
- func GetPacks(c *gin.Context)
- func ImportFromLighterPack(c *gin.Context)
- func PostMyPack(c *gin.Context)
- func PostMyPackContent(c *gin.Context)
- func PostPack(c *gin.Context)
- func PostPackContent(c *gin.Context)
- func PutMyPackByID(c *gin.Context)
- func PutMyPackContentByID(c *gin.Context)
- func PutPackByID(c *gin.Context)
- func PutPackContentByID(c *gin.Context)
- func SharedList(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
var ErrPackContentNotFound = errors.New("pack content not found")
ErrPackContentNotFound is returned when no item are found in a given pack
var ErrPackNotFound = errors.New("pack not found")
ErrPackNotFound is returned when a pack is not found
Functions ¶
func DeleteMyPackByID ¶
Delete a pack by ID @Summary Delete a pack by ID @Description Delete a pack by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} dataset.OkResponse "Pack deleted" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [delete]
func DeleteMyPackContentByID ¶
Delete a pack content ID by Pack ID @Summary Delete a pack content by ID @Description Delete a pack content by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Param item_id path int true "Item ID" @Success 200 {object} dataset.OkResponse "Pack Item deleted" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontent/{item_id} [delete]
func DeletePackByID ¶
func DeletePackContentByID ¶
Delete a pack content by ID @Summary [ADMIN] Delete a pack content by ID @Description Delete a pack content by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} map[string]string "message" @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents/{id} [delete]
func GetMyPackByID ¶
Get My pack by ID @Summary Get My pack by ID @Description Get pack by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [get]
func GetMyPackContentsByPackID ¶
Get pack content by ID @Summary Get pack content by ID @Description Get pack content by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} dataset.PackContent "Pack Item" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypackcontent/{id} [get]
func GetMyPacks ¶
Get My packs @Summary Get My Packs @Description Get my packs @Security Bearer @Tags Packs @Produce json @Success 200 {object} dataset.Packs "Packs" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 404 {object} dataset.ErrorResponse "No pack found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypacks [get]
func GetPackByID ¶
Get pack by ID @Summary [ADMIN] Get pack by ID @Description Get pack by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack ID" @Success 200 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /admin/packs/{id} [get]
func GetPackContentByID ¶
Get pack content by ID @Summary [ADMIN] Get pack content by ID @Description Get pack content by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents/{id} [get]
func GetPackContents ¶
Get all pack contents @Summary [ADMIN] Get all pack contents @Description Get all pack contents - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.PackContents @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents [get]
func GetPackContentsByPackID ¶
Get all pack contents @Summary [ADMIN] Get all pack contents @Description Get all pack contents - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.PackContents @Failure 400 {object} dataset.ErrorResponse @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs/:id/packcontents [get]
func GetPacks ¶
Get all packs @Summary [ADMIN] Get all packs @Description Get all packs - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.Packs @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs [get]
func ImportFromLighterPack ¶
Import from lighterpack @Summary Import from lighterpack csv pack file @Description Import from lighterpack csv pack file @Security Bearer @Tags Packs @Accept multipart/form-data @Produce json @Param file formData file true "CSV file" @Success 200 {object} dataset.OkResponse "CSV data imported successfully" @Failure 400 {object} dataset.ErrorResponse "Invalid CSV format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/import [post]
func PostMyPack ¶
Create a new pack @Summary Create a new pack @Description Create a new pack @Security Bearer @Tags Packs @Accept json @Produce json @Param pack body dataset.Pack true "Pack" @Success 201 {object} dataset.Pack "Pack created" @Failure 400 {object} dataset.ErrorResponse "Invalid Body format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack [post]
func PostMyPackContent ¶
Create a new pack content @Summary Create a new pack content @Description Create a new pack content @Security Bearer @Tags Packs @Accept json @Produce json @Param packcontent body dataset.PackContent true "Pack Content" @Success 201 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 401 {object} dataset.ErrorResponse @Failure 403 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /v1/mypackcontent [post]
func PostPack ¶
Create a new pack @Summary [ADMIN] Create a new pack @Description Create a new pack - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param pack body dataset.Pack true "Pack" @Success 201 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs [post]
func PostPackContent ¶
Create a new pack content @Summary [ADMIN] Create a new pack content @Description Create a new pack content - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param packcontent body dataset.PackContent true "Pack Content" @Success 201 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents [post]
func PutMyPackByID ¶
Update a pack by ID @Summary Update a pack by ID @Description Update a pack by ID @Security Bearer @Tags Packs @Accept json @Produce json @Param id path int true "Pack ID" @Param pack body dataset.Pack true "Pack" @Success 200 {object} dataset.Pack "Pack updated" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 400 {object} dataset.ErrorResponse "Invalid Payload" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [put]
func PutMyPackContentByID ¶
Update My pack content ID by Pack ID @Summary Update My pack content ID by Pack ID @Description Update My pack content ID by Pack ID @Security Bearer @Tags Packs @Accept json @Produce json @Param id path int true "Pack ID" @Param item_id path int true "Item ID" @Param packcontent body dataset.PackContent true "Pack Content" @Success 200 {object} dataset.PackContent "Pack Content updated" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 400 {object} dataset.ErrorResponse "Invalid Body format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontent/{item_id} [put]
func PutPackByID ¶
Update a pack by ID @Summary [ADMIN] Update a pack by ID @Description Update a pack by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Pack ID" @Param pack body dataset.Pack true "Pack" @Success 200 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs/{id} [put]
func PutPackContentByID ¶
Update a pack content by ID @Summary [ADMIN] Update a pack content by ID @Description Update a pack content by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Pack Content ID" @Param packcontent body dataset.PackContent true "Pack Content" @Success 200 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents/{id} [put]
func SharedList ¶ added in v0.4.0
Get pack content for a given sharing code @Summary Get pack content for a given sharing code @Description Get pack content for a given sharing code @Tags Public @Produce json @Param sharing_code path string true "Sharing Code" @Success 200 {object} dataset.PackContents "Pack Contents" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /public/packs/{sharing_code} [get]
Types ¶
This section is empty.