Documentation ¶
Overview ¶
Package http
Index ¶
- Variables
- func NewGetMetadataHandler(s *sakuin.Service) fiber.Handler
- func NewGetObjectHandler(s *sakuin.Service) fiber.Handler
- func NewIndexHandler(s *sakuin.Service) fiber.Handler
- func NewServer(s *sakuin.Service, cfg ...fiber.Config) *fiber.App
- func NewUpdateMetadataHandler(s *sakuin.Service) fiber.Handler
- func NewUpdateObjectHandler(s *sakuin.Service) fiber.Handler
- type APIError
Constants ¶
This section is empty.
Variables ¶
var (
ErrMissingObjectPart = APIError{
Message: "must provide object part in form data",
}
)
Functions ¶
func NewGetMetadataHandler ¶
NewGetMetadataHandler godoc @Summary Retrieve metadata for an object. @Tags Metadata @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 500 {object} APIError @Param id path string true "Object ID" @Router /index/{id}/metdata [get]
func NewGetObjectHandler ¶
NewGetObjectHandler godoc @Summary Retrieve an object. @Tags Objects @Accept json @Produce application/zip @Success 200 "Successfully return object contents in response body" @Failure 404 "Object not found" @Failure 500 {object} APIError @Param id path string true "Object ID" @Router /index/{id}/object [get]
func NewIndexHandler ¶
NewIndexHandler godoc @Summary index a new object along with its metadata @Tags Index @Accept multipart/form-data @Produce json @Param metadata body map[string]interface{} true "Object metadata" @Success 200 {object} pb.IndexResponse @Failure 400 {object} APIError @Failure 500 {object} APIError @Router /index [post]
func NewUpdateMetadataHandler ¶
NewUpdateMetadataHandler godoc @Summary Update object metadata by id. This will override and merge metadata fields. @Tags Metadata @Accept json @Success 200 "Successfully updated object metadata." @Failure 500 {object} APIError @Param id path string true "Object ID" @Router /index/{id}/metadata [put]
func NewUpdateObjectHandler ¶
NewUpdateObjectHandler godoc @Summary Update an object by id. This will completely replace an objects contents. @Tags Objects @Accept */* @Success 200 "Successfully updated object to new content." @Failure 500 {object} APIError @Param id path string true "Object ID" @Router /index/{id}/object [put]