Storage service orchestrating file operations.
This service coordinates file validation, storage, and image processing. Follows the Functional Core / Imperative Shell pattern where this service represents the imperative shell that coordinates pure validation logic with side-effectful storage operations.
Storage service orchestrating file operations. This service coordinates file validation, storage, and image processing. Follows the Functional Core / Imperative Shell pattern where this service represents the imperative shell that coordinates pure validation logic with side-effectful storage operations.
(create-storage-service {:keys [storage image-processor logger]})Create a storage service.
Parameters:
Create a storage service. Parameters: - storage: Implementation of IFileStorage - image-processor: Implementation of IImageProcessor (optional) - logger: Logger instance (optional)
Service for managing file storage operations.
Service for managing file storage operations.
(download-file _ file-key)Download a file by its storage key.
Returns: File data map or nil if not found
Download a file by its storage key. Returns: File data map or nil if not found
(get-file-url _ file-key expiration-seconds)Get a URL for accessing a file.
For public files, returns direct URL. For private files, returns signed URL with expiration.
Returns: URL string or nil
Get a URL for accessing a file. For public files, returns direct URL. For private files, returns signed URL with expiration. Returns: URL string or nil
(remove-file _ file-key)Remove a file from storage.
Returns: Boolean indicating success
Remove a file from storage. Returns: Boolean indicating success
(upload-file _ file-data metadata options)Upload a file with validation.
Parameters:
Returns: Storage result map or validation errors
Upload a file with validation. Parameters: - file-data: Map with :bytes and :content-type - metadata: Map with :filename and optional :path, :visibility - options: Map with optional :max-size, :allowed-types, :allowed-extensions Returns: Storage result map or validation errors
(upload-image _ image-bytes metadata options)Upload an image with optional processing.
Parameters:
Returns: Map with :original (storage result) and optional :thumbnail
Upload an image with optional processing. Parameters: - image-bytes: Byte array of the image - metadata: Map with :filename and optional :path, :visibility - options: Map with optional :resize, :create-thumbnail, :thumbnail-size Returns: Map with :original (storage result) and optional :thumbnail
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |