skip to content
$worker

storage

v0.1.7

S3-compatible object storage across AWS S3, GCS, Cloudflare R2, and a managed local rustfs backend. Streamed uploads, presigned URLs, and object change triggers.

iiiverified
110 installs7 in 7d0 today
install
$iii worker add storage@0.1.7
  • macOS: arm64 · x64
  • Linux: arm64 · armv7 · x64
  • Windows: arm64 · x64 · x86

exact versions are immutable; binary and bundle artifacts are digest-pinned.

functions

6

storage::deleteObject

function

Delete an object. No-op when the object does not exist.

request
  • bucketstringrequired
  • keystringrequired
  • version_idstring
response
  • deletedbooleanrequired

storage::getObject

function

Read an object. Body is base64; for large objects use presignUrl.

request
  • bucketstringrequired
  • keystringrequired
  • version_idstring
response
  • body_base64stringrequired
  • content_typestringrequired
  • etagstringrequired
  • last_modifiedstring· date-timerequired
  • sizeinteger· uint64requiredmin 0

storage::headObject

function

Fetch object metadata (size, ETag, content-type, last-modified) without downloading the body.

request
  • bucketstringrequired
  • keystringrequired
  • version_idstring
response
  • content_typestringrequired
  • etagstringrequired
  • last_modifiedstring· date-timerequired
  • sizeinteger· uint64requiredmin 0

storage::on-config-change

function

Internal: rebuild storage backends from the authoritative configuration when it changes.

request
  • idstring

    Configuration id that changed (advisory; the handler re-fetches the value).

response
  • okbooleanrequired

storage::presignUrl

function

Issue a short-lived URL the browser can hit directly to PUT or GET an object.

request
  • bucketstringrequired
  • content_typestring
  • expires_in_secondsinteger· uint64min 0
  • keystringrequired
  • methodstringrequiredenum: GET, PUT
  • response_content_dispositionstring

    GET-only: override `Content-Disposition` header on the served response. Rejected with `INVALID_PRESIGN_PARAMS` if set on a PUT presign.

  • response_content_typestring

    GET-only: override `Content-Type` header on the served response. Rejected with `INVALID_PRESIGN_PARAMS` if set on a PUT presign.

response
  • expires_atstring· date-timerequired
  • urlstringrequired

storage::putObject

function

Write an object to a configured bucket. Body is base64; max 10MB inline.

request
  • body_base64stringrequired

    Base64-encoded body. The legacy field name `body` is accepted as an alias for backward compatibility with clients that pre-date the rename.

  • bucketstringrequired
  • cache_controlstring
  • content_typestring
  • keystringrequired
  • metadataobject
response
  • etagstringrequired
  • sizeinteger· uint64requiredmin 0
  • version_idstring

triggers

2

storage::object-created

trigger

Fires when an object is written to a configured bucket whose notifications source is wired up.

invocation
valueunknown
return
valueunknown

storage::object-deleted

trigger

Fires when an object is removed from a configured bucket whose notifications source is wired up.

invocation
valueunknown
return
valueunknown