Go Files SDK
Unified Files API for Go apps.
A small Go storage layer for uploads, downloads, lists, and signed URLs across local, memory, S3, R2, and blob adapters.
Adapter directory
Choose storage at the edge of your system.
Storage shape
One path from Go data to storage.
The SDK keeps inputs, operations, and provider setup in separate places so app code can stay direct.
Accept a Go body
Reader, file, bytes, string, or a custom closer.
Pass through one client
Options, hooks, middleware, retries, and prefixes stay in one place.
Land in any backend
Cloud bucket, local disk, memory storage, or managed blob platform.
Same calls
One file flow. Different adapters.
Swap provider setup at the boundary; keep the upload and access calls in app code unchanged.
storage/client.go
No credentials, useful for tests and local development.
client := files.MustNew(files.Options{
Adapter: memory.New(memory.Options{}),
})
_, err := client.Upload(
ctx,
"reports/q1.txt",
files.StringBody("revenue: 42"),
files.UploadOptions{ContentType: "text/plain"},
)Runtime controls
Put storage policy beside storage calls.
Prefixes, hooks, middleware, retries, timeouts, and read-only mode stay in the SDK layer so app code can stay direct.
Read-only mode
Protect environments that should never mutate stored files.
Retries and timeouts
Keep transient provider failures away from app code.
List and search
Expose object discovery without binding callers to provider APIs.
Signed URLs
Generate temporary access at the same call site everywhere.
Start
Add one module. Move storage decisions later.
Start with memory or filesystem in development, then point the same file flow at S3, R2, or a managed provider in production.