s3blob

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package s3blob implements the blob.Store interface backed by an S3-compatible object store (MinIO in dev, and any S3-compatible service in production). It is a drop-in swap for blob.LocalStore, preserving the same content-addressable dedup semantics: identical content bytes hash to the same key and are only ever uploaded once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	Bucket          string
	UseSSL          bool
}

Config holds the connection details for an S3-compatible object store.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store stores blobs in an S3-compatible bucket, keyed by their full hex sha256 digest (no sharding — S3 doesn't need it the way a local filesystem does).

func New

func New(ctx context.Context, cfg Config) (*Store, error)

New constructs a Store, connecting to the configured S3-compatible endpoint and ensuring the target bucket exists (creating it if missing) so callers don't need a separate provisioning step.

func (*Store) Get

func (s *Store) Get(contentHash string) ([]byte, error)

Get returns the exact original bytes for contentHash.

func (*Store) Has

func (s *Store) Has(contentHash string) (bool, error)

Has reports whether an object with contentHash exists. A "not found" response is a valid false result, not an error.

func (*Store) Put

func (s *Store) Put(content []byte) (string, error)

Put uploads content, deduplicating by content hash: if an object with the same hash already exists, it is not re-uploaded.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL