Skip to main content

Crate shardline_oci_adapter

Crate shardline_oci_adapter 

Source
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§

OciS3MultipartUploadSession
OciUploadSession
OciUploadSessionLock
SerializableSha256State

Enums§

OciAdapterError
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 Digest or Tag.
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.