brane_api::packages

Function upload

Source
pub async fn upload<S, B>(
    package_archive: S,
    context: Context,
) -> Result<impl Reply, Rejection>
where S: StreamExt<Item = Result<B, Error>> + Unpin, B: Buf,
Expand description

Uploads a new package (container) to the central registry.

§Arguments

  • package_archive: The Bytes of the package archive to store somewhere.
  • context: The Context that stores properties about the environment, such as the directory where we store the container files.

§Returns

The Warp reply that contains the status code of the thing (e.g., OK if everything went fine).

§Errors

This function errors if we fail to either write the package info to the Scylla database or the package archive to the local filesystem.