s3

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, sha256 string) (io.ReadCloser, int64, string, error)

Get retrieves content by SHA-256 hash.

func Head(ctx context.Context, sha256 string) (int64, bool, error)

Head checks if a blob exists and returns its size.

func HealthCheck

func HealthCheck(ctx context.Context) error

HealthCheck verifies S3 is still reachable.

func Init

func Init(ctx context.Context) error

Init connects to S3 and verifies the bucket exists. Reads config from environment: S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET. Call this at startup — fails fast if S3 is unreachable or misconfigured.

func Put

func Put(ctx context.Context, sha256 string, reader io.Reader, size int64, contentType string) error

Put stores content by SHA-256 hash. Idempotent — overwrites are identical by definition.

Types

This section is empty.

Jump to

Keyboard shortcuts

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