objectstore

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package objectstore provides provider-neutral immutable object publication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evidence

type Evidence struct {
	SHA256    string
	SizeBytes int64
	ETag      string
}

Evidence proves immutable object identity without exposing provider credentials.

type S3Config

type S3Config struct {
	Endpoint         string
	Region           string
	Bucket           string
	AccessKeyID      string
	SecretAccessKey  string
	UsePathStyle     bool
	RetryMaxAttempts int
	HTTPTimeout      time.Duration
	TempDirectory    string
	MaxObjectBytes   int64
}

S3Config contains explicit S3-compatible authority.

type S3Store

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

S3Store publishes immutable objects to one S3-compatible bucket.

func NewS3Store

func NewS3Store(ctx context.Context, objectConfig S3Config) (*S3Store, error)

NewS3Store constructs an S3-compatible immutable object store.

func (*S3Store) Delete

func (store *S3Store) Delete(ctx context.Context, key string) error

Delete removes an unreachable immutable object during garbage collection.

func (*S3Store) GetVerified

func (store *S3Store) GetVerified(
	ctx context.Context,
	key string,
	expected Evidence,
) (_ io.ReadCloser, evidence Evidence, resultErr error)

GetVerified buffers and verifies immutable bytes before exposing them to restore.

func (*S3Store) HeadVerified

func (store *S3Store) HeadVerified(ctx context.Context, key string, expected Evidence) (Evidence, error)

HeadVerified proves that published provider metadata matches database evidence.

func (*S3Store) PutImmutable

func (store *S3Store) PutImmutable(
	ctx context.Context,
	key string,
	reader io.Reader,
	sizeBytes int64,
	expectedSHA256 string,
) (evidence Evidence, resultErr error)

PutImmutable validates bytes before upload and verifies provider evidence afterwards.

type Store

type Store interface {
	PutImmutable(context.Context, string, io.Reader, int64, string) (Evidence, error)
	HeadVerified(context.Context, string, Evidence) (Evidence, error)
	GetVerified(context.Context, string, Evidence) (io.ReadCloser, Evidence, error)
	Delete(context.Context, string) error
}

Store is the small provider-neutral durable object boundary.

Jump to

Keyboard shortcuts

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