(cloud-storage-client {:keys [client project-id host]})Create a GCS client. Supports :host for emulator endpoint (e.g., 'http://localhost:4443').
Create a GCS client. Supports :host for emulator endpoint (e.g., 'http://localhost:4443').
(copy-blob client bucket store-path from-blob-key to-blob-key)Copy blob from one key to another. Returns nil if source doesn't exist.
Copy blob from one key to another. Returns nil if source doesn't exist.
(delete-blob client bucket store-path blob-key)Delete blob. Returns true if deleted, false if not found.
Delete blob. Returns true if deleted, false if not found.
(read-blob-with-generation client blob-id)Read blob and return {:data :generation}, ::not-found if the blob is genuinely
absent (.get returns nil), or nil if it was deleted DURING the read (404 —
stale generation, i.e. a concurrent-modification conflict). The two absent
cases are distinguished so PReadMissSafe can turn a genuine miss into
store-key-not-found while optimistic locking still sees the conflict.
Read blob and return {:data :generation}, ::not-found if the blob is genuinely
absent (`.get` returns nil), or nil if it was deleted DURING the read (404 —
stale generation, i.e. a concurrent-modification conflict). The two absent
cases are distinguished so PReadMissSafe can turn a genuine miss into
store-key-not-found while optimistic locking still sees the conflict.(store-exists? spec & {:keys [opts]})Check if a konserve store exists at the given spec.
Check if a konserve store exists at the given spec.
(write-blob-conditional client blob-id bytes expected-generation)Write bytes only if the object's generation is still expected-generation, or
— when that is :absent — only if there is no object. True on success, false
when GCS refuses.
GCS evaluates the precondition itself, which is what makes this backing's
guarantee :global: the comparison and the write are one step against every
writer anywhere, not merely those sharing a filesystem or a heap.
Create-if-absent is ifGenerationMatch(0). Zero is GCS's way of saying THE
OBJECT MUST NOT EXIST, and using it keeps both halves of the contract on one
mechanism rather than adding a separate existence probe that another writer
could slip past.
412 is the refusal in both cases.
Write `bytes` only if the object's generation is still `expected-generation`, or — when that is `:absent` — only if there is no object. True on success, false when GCS refuses. GCS evaluates the precondition itself, which is what makes this backing's guarantee `:global`: the comparison and the write are one step against every writer anywhere, not merely those sharing a filesystem or a heap. Create-if-absent is `ifGenerationMatch(0)`. Zero is GCS's way of saying THE OBJECT MUST NOT EXIST, and using it keeps both halves of the contract on one mechanism rather than adding a separate existence probe that another writer could slip past. 412 is the refusal in both cases.
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 |