Expand description
OCI Distribution protocol adapter for the Shardline server ecosystem.
This crate provides OCI registry protocol support: upload session management, manifest and blob key construction, content-addressed storage helpers, and S3 multipart upload orchestration.
§Quick start
The reference and key helpers are pure and are the easiest place to start:
use shardline_oci_adapter::{OciReference, parse_reference, validate_repository};
// A reference is either a `sha256:` digest or a tag.
let digest = parse_reference(
"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
)?;
assert!(matches!(digest, OciReference::Digest(_)));
let tag = parse_reference("v1.2.3")?;
assert!(matches!(tag, OciReference::Tag(_)));
// Repository names follow OCI naming rules.
assert!(validate_repository("acme/models").is_ok());
assert!(validate_repository("Acme/Models").is_err());oci_*_key functions map those references to validated storage
ObjectKey values:
use shardline_oci_adapter::oci_blob_key;
let key = oci_blob_key(
"acme/models",
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
None,
)?;
assert!(key.as_str().starts_with("protocols/oci/"));
assert!(key.as_str().ends_with(
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
));Structs§
Enums§
- OciAdapter
Error - OCI adapter failure.
- OciReference
Traits§
- OciBackend
- Backend operations required by the OCI adapter.
Functions§
- abort_
s3_ multipart_ upload_ session - Errors
- append_
s3_ multipart_ upload_ bytes - Errors
- append_
s3_ multipart_ upload_ bytes_ owned - Append shared bytes, retaining their owner in every outstanding part/tail write.
- append_
upload_ bytes - Errors
- append_
upload_ bytes_ owned - Append shared bytes while retaining their owner through blocking persistence.
- create_
upload_ session - Errors
- delete_
upload_ session - Errors
- finalize_
s3_ multipart_ upload_ session - Errors
- lock_
upload_ sessions - Errors
- new_
upload_ session_ id - oci_
blob_ key - Builds the storage object key for a blob in an OCI repository.
- oci_
blob_ key_ from_ namespace - Rebuilds an OCI blob key from its durable tombstone namespace.
- oci_
blob_ location - Returns the registry URL path for a blob in an OCI repository.
- oci_
manifest_ key - Errors
- oci_
manifest_ key_ from_ namespace - Rebuilds an OCI manifest key from its durable tombstone namespace.
- oci_
manifest_ location - Returns the registry URL path for a manifest in an OCI repository.
- oci_
manifest_ media_ type_ key - Errors
- oci_
manifest_ media_ type_ key_ from_ namespace - Rebuilds an OCI manifest media-type key from its durable tombstone namespace.
- oci_
manifest_ prefix - Returns the object prefix for manifest digests in an OCI repository.
- oci_
tag_ key - Errors
- oci_
tag_ prefix - Errors
- oci_
tag_ target_ key - Errors
- oci_
tag_ target_ prefix - Errors
- parse_
reference - Parses an OCI reference into a
DigestorTag. - purge_
expired_ upload_ sessions - Errors
- read_
upload_ session - Errors
- repair_
upload_ session_ evidence - Explicitly persists canonical lifecycle, snapshot, and Merkle evidence for a legacy upload session. Normal reads never mutate filesystem state.
- touch_
upload_ session - Errors
- upload_
body_ integrity - Errors
- upload_
body_ path_ for_ session - Errors
- upload_
length - Errors
- upload_
session_ length - upload_
session_ location - validate_
repository - Validates an OCI repository name against the registry naming rules.