S3 Blob Store (blobstore/blobstore.go)

omnara · internal/blobstore/blobstore.go · go · Apache-2.0
database, files, infra, lang:go, tag:content-digest

Implements key-addressed blob storage with an S3 backend, content digests, and put/get/delete operations. Reuse for artifact or blob persistence.

// Source: https://github.com/omnara-ai/omnara | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Package blobstore defines the key-addressed blob storage contract and
// its S3 backend.
package blobstore

import (
	"bytes"
	"context"
	"crypto/sha256"
	"encoding/hex"
	"errors"
	"fmt"
	"io"

	"github.com/aws/aws-sdk-go-v2/aws"
	awsconfig "github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/credentials"
	"github.com/aws/aws-sdk-go-v2/service/s3"
	"github.com/aws/aws-sdk-go-v2/service/s3/types"
)

var ErrNotFound = errors.New("blob not found")

// ContentDigest is the canonical digest format for blob content; artifact
// idempotent-replay validation compares these dig

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key