Skip to main content

Unified file storage interface for Go

One Storage interface for local filesystem, AWS S3, Google Cloud Storage, Azure Blob Storage, and in-memory testing. Write your storage layer once — swap the backend with configuration, not code.

go get github.com/KARTIKrocks/objstore

One Interface

Put, Get, Delete, Exists, Stat, List, Copy, Move, URL, SignedURL — identical on every backend

Five Backends

Local filesystem, AWS S3, Google Cloud Storage, Azure Blob, and in-memory

S3-Compatible Services

MinIO, DigitalOcean Spaces, Cloudflare R2, Backblaze B2, Wasabi via endpoint + path-style config

Streaming Multipart Upload

Bodies past 5MiB split into bounded-memory parts through S3's multipart uploader automatically

Signed URLs Everywhere

Cloud backends presign natively; local and memory produce verifiable HMAC-signed URLs

Ranged Downloads

Resume downloads or seek into large files with byte-range requests

Conditional Writes

Atomic create-only writes and ETag compare-and-swap updates, enforced natively by each provider

Built-in Helpers

Unique/date/hash-distributed path generation, file-type detection, size formatting, directory sync

Zero-Dependency Testing

In-memory backend for unit tests — no cloud credentials, no network

Sentinel Errors

A small, consistent error set matched with errors.Is across every backend

One interface, five backends

Every backend below implements the same objstore.Storage interface. Develop against memory or local disk, then point the same code at S3, GCS, or Azure in production — see Switching Backends.

Local Filesystem

Disk-backed storage with an HMAC-signable base URL

AWS S3

Multipart uploads, IAM roles, path prefixes, custom endpoints

Google Cloud Storage

Service account, JSON, or default credentials

Azure Blob Storage

Account key, connection string, or managed identity

In-Memory

Zero-dependency backend built for tests

The same operations, everywhere

No backend-specific escape hatches to learn — these ten operations are all you need, and they behave the same on every backend.

PutGetDeleteExistsStatListCopyMoveURLSignedURL