Documentation
¶
Overview ¶
Package blob is the storage-layer port (ADR-0007): opaque byte objects behind the blob.Bucket port. It is the bytes substrate, sibling to the store (records) — deliberately named "blob", not "storage", to stay distinct from "store".
This package imports no driver library; the gocloud.dev/blob adapter (memory / file / S3, all pure-Go) lives in internal/blob/gocloud.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
Attributes is the listing metadata for one object.
type Bucket ¶
type Bucket interface {
Get(ctx context.Context, key string) ([]byte, error)
Put(ctx context.Context, key string, data []byte) error
Delete(ctx context.Context, key string) error
Exists(ctx context.Context, key string) (bool, error)
List(ctx context.Context, prefix string) ([]Attributes, error)
SignedURL(ctx context.Context, key string, opts SignOptions) (string, error)
Close() error
}
Bucket is the storage-layer port: opaque byte objects keyed by a path string. Errors are api/fault kinds; every method is ctx-first.
func Capped ¶ added in v0.2.1
Capped returns a view of inner whose Put refuses an object larger than maxBytes with fault.Forbidden: the Bucket.spec.maxObjectBytes per-object policy (ADR-0080). It also refuses to sign a PUT URL, since the upload then bypasses Put and SignOptions carries no size limit to bind it. maxBytes <= 0 returns inner unchanged. It forwards the optional RangeReader capability when inner implements it.
func Prefixed ¶
Prefixed returns a Bucket view of inner whose keys are all transparently prefixed with keyPrefix (ADR-0080): it scopes a single shared substrate bucket into many logical buckets (e.g. one per (namespace, Bucket) S3 domain) without a separate backend per bucket. A trailing "/" on keyPrefix is recommended for a clean boundary. It forwards the optional RangeReader capability when inner implements it.
type RangeReader ¶
type RangeReader interface {
// GetRange returns bytes [offset, offset+length) of the object at key.
// A negative length means "to end". offset must be >= 0. fault.NotFound if the
// key is absent; fault.Invalid for a negative offset.
GetRange(ctx context.Context, key string, offset, length int64) ([]byte, error)
}
RangeReader is an OPTIONAL capability a blob.Bucket driver MAY implement: a byte-range read of an object (ADR-0080). The s3gateway type-asserts a Bucket to RangeReader to serve DuckDB's ranged Parquet reads efficiently and FALLS BACK to a full Get+slice when the driver does not implement it. Keeping it a separate, optional interface keeps the blob.Bucket port minimal and the contract tests additive.
type SignMethod ¶
type SignMethod string
SignMethod is the typed HTTP method a SignedURL grants (ADR-0002: typed over magic strings).
const ( SignGet SignMethod = "GET" SignPut SignMethod = "PUT" SignDelete SignMethod = "DELETE" )
type SignOptions ¶
type SignOptions struct {
Method SignMethod
Expiry time.Duration
}
SignOptions configures a SignedURL request. A zero Method means SignGet; a zero Expiry means the driver's default (15m).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package blobcontract is the shared conformance suite for the blob.Bucket port (ADR-0007).
|
Package blobcontract is the shared conformance suite for the blob.Bucket port (ADR-0007). |
|
Package gocloud is the gocloud.dev/blob driver for the blob.Bucket port (ADR-0007): memory / file / S3 by URL, all pure-Go (no cgo).
|
Package gocloud is the gocloud.dev/blob driver for the blob.Bucket port (ADR-0007): memory / file / S3 by URL, all pure-Go (no cgo). |
|
Package s3gateway is the funcd S3-protocol frontend over the blob.Bucket substrate (ADR-0080), with in-platform identity via funcd-managed per-function SigV4 keypairs resolved by an in-process versitygw auth.IAMService (ADR-0085).
|
Package s3gateway is the funcd S3-protocol frontend over the blob.Bucket substrate (ADR-0080), with in-platform identity via funcd-managed per-function SigV4 keypairs resolved by an in-process versitygw auth.IAMService (ADR-0085). |