awss3

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 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 such as LocalStack. Useful as a credential-free origin for the dev harness: LocalStack acts as both origin and cachestore (different buckets).

This driver is read-only from Orca's perspective (Head, GetRange, List). 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.

func (*Adapter) List

func (a *Adapter) List(ctx context.Context, bucket, prefix, marker string, maxResults int) (origin.ListResult, error)

List enumerates objects under prefix.

type Config

type Config struct {
	// Endpoint, when set, overrides the regional default and routes
	// requests at a custom URL (LocalStack uses
	// http://localstack:4566). Leave empty for real AWS S3.
	Endpoint string

	// Region is the AWS region. LocalStack ignores this; the SDK
	// requires a value.
	Region string

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

	// AccessKey / SecretKey are static credentials. For LocalStack
	// these are "test"/"test"; for real AWS, supply real creds.
	AccessKey string
	SecretKey string

	// UsePathStyle: true for LocalStack (host-based addressing
	// requires DNS wildcards LocalStack 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