awss3

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package awss3 is the AWS S3 (and S3-compatible) origin driver. It targets either real AWS S3 or a local S3-compatible endpoint. Useful as a credential-free origin for the dev harness, where the same S3-compatible store acts as both origin and cachestore (different buckets).

This driver is read-only from Orca's perspective (Head, GetRange). The seed step that uploads test objects to the origin bucket happens out-of-band via aws-cli or similar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements origin.Origin against an S3-compatible endpoint.

func New

func New(ctx context.Context, cfg Config, log *slog.Logger) (*Adapter, error)

New constructs an Adapter. The log receives debug-level emissions for every Head / GetRange / List call and the error mapping decision (not-found / auth / precondition) on failure paths. Passing nil falls back to slog.Default().

func (*Adapter) GetRange

func (a *Adapter) GetRange(ctx context.Context, bucket, key, etag string, off, n int64) (io.ReadCloser, error)

GetRange fetches [off, off+n) of the object, sending If-Match: <etag>.

func (*Adapter) Head

func (a *Adapter) Head(ctx context.Context, bucket, key string) (origin.ObjectInfo, error)

Head returns ObjectInfo for the named object. The bucket arg lets callers override the configured bucket; if empty, the configured bucket is used.

type Config

type Config struct {
	// Endpoint, when set, overrides the regional default and routes
	// requests at a custom URL (the dev harness uses a local
	// S3-compatible endpoint). Leave empty for real AWS S3.
	Endpoint string

	// Region is the AWS region. Some S3-compatible backends validate
	// it against their configured region; the SDK requires a value.
	Region string

	// Bucket is the source bucket holding origin objects.
	Bucket string

	// AccessKey / SecretKey are static credentials. For the dev
	// harness these are deterministic dev keys; for real AWS, supply
	// real creds.
	AccessKey string
	SecretKey string

	// UsePathStyle: true for the S3-compatible dev backend (host-based
	// addressing requires DNS wildcards it does not provide).
	UsePathStyle bool
}

Config is the awss3-driver configuration. Mirrors config.AWSS3 but kept package-local so the driver can be unit-tested without importing the whole config package.

Jump to

Keyboard shortcuts

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