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 ¶
- type Adapter
- func (a *Adapter) GetRange(ctx context.Context, bucket, key, etag string, off, n int64) (io.ReadCloser, error)
- func (a *Adapter) Head(ctx context.Context, bucket, key string) (origin.ObjectInfo, error)
- func (a *Adapter) List(ctx context.Context, bucket, prefix, marker string, maxResults int) (origin.ListResult, error)
- type Config
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 ¶
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>.
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.