fileassethttp

package
v0.0.0-...-1f1dc5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package fileassethttp adapts file metadata HTTP requests to the file usecase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(group *echo.Group, handler *Handler)

Register mounts file routes on group.

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

func (h *Handler) CreateCategory(c *echo.Context) error

CreateCategory adds one file category.

func (*Handler) DeleteCategory

func (h *Handler) DeleteCategory(c *echo.Context) error

DeleteCategory removes one file category without deleting files.

func (*Handler) DeleteFile

func (h *Handler) DeleteFile(c *echo.Context) error

DeleteFile removes one file metadata record and its local upload when present.

func (*Handler) ImportURL

func (h *Handler) ImportURL(c *echo.Context) error

ImportURL registers an external HTTP(S) URL as a file asset.

func (*Handler) ListCategories

func (h *Handler) ListCategories(c *echo.Context) error

ListCategories returns the category tree used by file management.

func (*Handler) ListFiles

func (h *Handler) ListFiles(c *echo.Context) error

ListFiles returns uploaded file records.

func (*Handler) RenameFile

func (h *Handler) RenameFile(c *echo.Context) error

RenameFile updates one file display name.

func (*Handler) ServeUpload

func (h *Handler) ServeUpload(c *echo.Context) error

ServeUpload returns one local uploaded file after boot-level route authorization has accepted the request.

func (*Handler) UpdateCategory

func (h *Handler) UpdateCategory(c *echo.Context) error

UpdateCategory changes one file category.

func (*Handler) UploadFile

func (h *Handler) UploadFile(c *echo.Context) error

UploadFile stores one uploaded file and records its metadata.

type OperationRecorder

type OperationRecorder interface {
	RecordOperation(context.Context, auditusecase.OperationInput) (auditusecase.OperationLog, error)
}

OperationRecorder records file mutations for audit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL