Documentation
¶
Overview ¶
Package fileassethttp adapts file metadata HTTP requests to the file usecase.
Index ¶
- func Register(group *echo.Group, handler *Handler)
- type Handler
- func (h *Handler) CreateCategory(c *echo.Context) error
- func (h *Handler) DeleteCategory(c *echo.Context) error
- func (h *Handler) DeleteFile(c *echo.Context) error
- func (h *Handler) ImportURL(c *echo.Context) error
- func (h *Handler) ListCategories(c *echo.Context) error
- func (h *Handler) ListFiles(c *echo.Context) error
- func (h *Handler) RenameFile(c *echo.Context) error
- func (h *Handler) ServeUpload(c *echo.Context) error
- func (h *Handler) UpdateCategory(c *echo.Context) error
- func (h *Handler) UploadFile(c *echo.Context) error
- type OperationRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler adapts file HTTP requests to the file usecase.
func New ¶
func New(uc *usecase.Usecase, operation OperationRecorder, uploadDir string) *Handler
New creates a file HTTP handler.
func (*Handler) CreateCategory ¶
CreateCategory adds one file category.
func (*Handler) DeleteCategory ¶
DeleteCategory removes one file category without deleting files.
func (*Handler) DeleteFile ¶
DeleteFile removes one file metadata record and its local upload when present.
func (*Handler) ListCategories ¶
ListCategories returns the category tree used by file management.
func (*Handler) RenameFile ¶
RenameFile updates one file display name.
func (*Handler) ServeUpload ¶
ServeUpload returns one local uploaded file after boot-level route authorization has accepted the request.
func (*Handler) UpdateCategory ¶
UpdateCategory changes one file category.
type OperationRecorder ¶
type OperationRecorder interface {
RecordOperation(context.Context, auditusecase.OperationInput) (auditusecase.OperationLog, error)
}
OperationRecorder records file mutations for audit.