Skip to content

Storage v0.13.0

Choose a tag to compare

@cmilesio cmilesio released this 03 Dec 04:04
· 18 commits to main since this release

Storage operations now take a context.Context as their first argument. Reuse a disk across requests and pass each request's deadline or cancellation directly to the operation.

body, err := disk.Get(ctx, "uploads/report.pdf")

Upgrading

  • Use storage.Build(ctx, cfg), storage.New(ctx, cfg), and driver.New(ctx, cfg) for setup. Use disk.Get(ctx, path) in place of disk.WithContext(ctx).Get(path). The same convention applies to writes, file counts, and paginated listings.
  • Rename streaming calls to OpenObject, PutObject, and WalkObjects. Use s3storage.PrepareBucket(ctx, cfg) to explicitly provision an S3 bucket.
  • Update custom drivers and test doubles to accept context and implement Close() error. Close standalone disks with disk.Close() and manager-owned disks with manager.Close().

Upgrade the root package and the drivers you use together. For example, upgrade Storage and the local driver with Go 1.25 or newer.

go get github.com/goforj/storage github.com/goforj/storage/driver/localstorage

The root package, storagecore, storagetest, and all 14 drivers have their own module tags. The root requires Go 1.24.4. Driver and test helper minimums remain unchanged.

Context-first API · Disk cleanup