Liking cljdoc? Tell your friends :D

wagoe.storage.shell.http-handlers

HTTP handlers for file upload and download operations.

Provides Ring-compatible handlers for file operations.

HTTP handlers for file upload and download operations.

Provides Ring-compatible handlers for file operations.
raw docstring

delete-file-handlerclj

(delete-file-handler storage-service & [may-access?])

Handler for file deletion endpoint.

Path parameter:

  • file-key: Storage key of the file
Handler for file deletion endpoint.

Path parameter:
- file-key: Storage key of the file
sourceraw docstring

download-file-handlerclj

(download-file-handler storage-service)
(download-file-handler storage-service signing-secret & [may-access?])

Handler for file download endpoint.

Path parameter:

  • file-key: Storage key of the file
Handler for file download endpoint.

Path parameter:
- file-key: Storage key of the file
sourceraw docstring

get-file-url-handlerclj

(get-file-url-handler storage-service & [may-access?])

Handler for getting a file URL (direct or signed).

Path parameter:

  • file-key: Storage key of the file

Query parameter:

  • expiration: Expiration time in seconds (optional, default: 3600)
Handler for getting a file URL (direct or signed).

Path parameter:
- file-key: Storage key of the file

Query parameter:
- expiration: Expiration time in seconds (optional, default: 3600)
sourceraw docstring

storage-routesclj

(storage-routes storage-service)
(storage-routes storage-service
                {:keys [base-path signing-secret may-access? upload-limits]})

Reitit route data for the storage endpoints, as this module's :api.

Versioning prepends /api/v1, so paths here carry no /api prefix.

Parameters:

  • storage-service: Instance of IStorageService
  • options: Map with optional :base-path (default: "/storage") and :may-access?, the app's check on a key (libs/storage/AGENTS.md, BOU-1075), and :upload-limits, {:max-size :allowed-types :allowed-extensions} (BOU-1076)
Reitit route data for the storage endpoints, as this module's `:api`.

Versioning prepends `/api/v1`, so paths here carry no `/api` prefix.

Parameters:
- storage-service: Instance of IStorageService
- options: Map with optional :base-path (default: "/storage") and
  :may-access?, the app's check on a key (libs/storage/AGENTS.md, BOU-1075),
  and :upload-limits, {:max-size :allowed-types :allowed-extensions} (BOU-1076)
sourceraw docstring

upload-file-handlerclj

(upload-file-handler storage-service & [may-access? limits])

Handler for file upload endpoint.

Expects multipart/form-data with:

  • file: The file to upload (required)
  • path: Storage path (optional)
  • visibility: 'public' or 'private' (optional, default: private)

Query parameters, which can only tighten the configured limits (BOU-1076):

  • max-size: Maximum file size in bytes
  • allowed-types: Comma-separated list of allowed MIME types
  • allowed-extensions: Comma-separated list of allowed extensions
Handler for file upload endpoint.

Expects multipart/form-data with:
- file: The file to upload (required)
- path: Storage path (optional)
- visibility: 'public' or 'private' (optional, default: private)

Query parameters, which can only tighten the configured `limits` (BOU-1076):
- max-size: Maximum file size in bytes
- allowed-types: Comma-separated list of allowed MIME types
- allowed-extensions: Comma-separated list of allowed extensions
sourceraw docstring

upload-image-handlerclj

(upload-image-handler storage-service & [may-access? limits])

Handler for image upload endpoint with processing options.

Expects multipart/form-data with:

  • file: The image file to upload (required)
  • path: Storage path (optional)
  • visibility: 'public' or 'private' (optional)
  • create-thumbnail: 'true' to create thumbnail (optional)
  • thumbnail-size: Thumbnail max dimension in pixels (optional, default: 200)

The configured limits hold here too (BOU-1076).

Handler for image upload endpoint with processing options.

Expects multipart/form-data with:
- file: The image file to upload (required)
- path: Storage path (optional)
- visibility: 'public' or 'private' (optional)
- create-thumbnail: 'true' to create thumbnail (optional)
- thumbnail-size: Thumbnail max dimension in pixels (optional, default: 200)

The configured `limits` hold here too (BOU-1076).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close