Documentation
¶
Overview ¶
Package origin defines the upstream-blob-store interface and shared types. Concrete adapters live under origin/<driver>/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("origin: not found") ErrAuth = errors.New("origin: auth") )
Sentinel errors. Wrap with %w so callers use errors.Is.
Driver contract:
- ErrNotFound: blob does not exist. AWS S3 driver returns this for NoSuchKey responses; the azureblob driver for BlobNotFound / ContainerNotFound.
- ErrAuth: 401 / 403. AWS S3 driver returns this for AccessDenied and similar; the azureblob driver for HTTP 401/403 and the AuthenticationFailed / AuthorizationFailure codes.
New drivers should map their SDK-specific not-found and auth indicators onto these sentinels so handlers can route consistently via errors.Is.
Functions ¶
Types ¶
type MissingETagError ¶
MissingETagError is returned by the fetch coordinator when an origin Head response carries an empty ETag. chunk.Path encodes the ETag in its hash input; a stable cache key requires the origin to supply one. Misconfigured backends (some S3-compatible implementations with specific bucket policies, custom origins not following the AWS/Azure contract) can omit ETags, in which case two different versions of the same (bucket, key) would alias to the same chunk.Path and orca would silently serve stale bytes. Rejecting at Head time surfaces the misconfiguration immediately instead of after observable corruption.
func (*MissingETagError) Error ¶
func (e *MissingETagError) Error() string
type ObjectInfo ¶
ObjectInfo is the result of a successful Head.
type Origin ¶
type Origin interface {
// Head returns object metadata. If the blob does not exist, returns
// ErrNotFound. If the blob is an unsupported type (e.g., azureblob
// non-BlockBlob), returns UnsupportedBlobTypeError.
Head(ctx context.Context, bucket, key string) (ObjectInfo, error)
// GetRange fetches [off, off+n) bytes of the object. The etag is
// passed as `If-Match: <etag>` so a mid-flight overwrite is detected
// at the wire (returns OriginETagChangedError).
GetRange(ctx context.Context, bucket, key, etag string, off, n int64) (io.ReadCloser, error)
}
Origin is a read-only view of an upstream blob store.
type OriginETagChangedError ¶
OriginETagChangedError is returned by GetRange when the origin rejects the If-Match precondition.
func (*OriginETagChangedError) Error ¶
func (e *OriginETagChangedError) Error() string
type UnsupportedBlobTypeError ¶
UnsupportedBlobTypeError is returned by azureblob.Head when the target is a Page or Append blob. Orca only serves Block Blobs.
func (*UnsupportedBlobTypeError) Error ¶
func (e *UnsupportedBlobTypeError) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package awss3 is the AWS S3 (and S3-compatible) origin driver.
|
Package awss3 is the AWS S3 (and S3-compatible) origin driver. |
|
Package azureblob is the Azure Blob Storage adapter for the Origin interface.
|
Package azureblob is the Azure Blob Storage adapter for the Origin interface. |