Skip to main content

Module server

Module server 

Source
Expand description

A read-only OCI Distribution router, independent of HTTP and storage runtimes.

Supply a Store (borrowed memory, flash, or a memfs), and pass an HTTP method and origin-form request target to serve. Only listings use the caller’s scratch buffer; manifests and blobs are borrowed directly from the store. Transports must send the response metadata, including HEAD’s content length, and may add CORS, authentication, caching, or TLS outside this module. Uploads, deletion, referrers, ranges, and Accept negotiation are not supported.

Structs§

BufferTooSmall
The scratch buffer cannot hold the generated listing. No partial response is returned; the transport can retry with more space or return HTTP 500.
Content
Immutable bytes and their OCI media type and content digest.
MemoryStore
An allocation-free store of borrowed slices. Fields may point to ROM, include_bytes! assets, or buffers owned by the caller.
NextLink
Format as an HTTP Link header. The cursor is percent encoded.
Repository
A borrowed repository, including untagged manifests (e.g. index children).
Response
Metadata and body to pass to an HTTP transport.
Tag
A tag alias for a manifest in Repository::manifests.

Traits§

Store
Storage contract for a read-only registry.

Functions§

serve
Serve GET/HEAD and OPTIONS from a read-only registry. Pagination accepts nonnegative n and a percent-encoded last cursor (maximum 256 decoded bytes). n=0 returns an empty page without a continuation link. Unknown query parameters are ignored. Malformed known parameters return 400. Listings are lexically sorted even if the store’s names are unsorted.