| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Cargo.Publish.Body
Description
Native Cargo upload framing rejects ambiguous JSON and retains the exact archive bytes.
Synopsis
- data CargoUploadBody
- decodeUpload :: Limits -> ByteString -> Either ParseError CargoUploadBody
- readUpload :: Limits -> (Int -> IO ()) -> ByteString -> IO (Either ParseError (CargoUploadBody, Int))
- uploadName :: CargoUploadBody -> Text
- uploadVersion :: CargoUploadBody -> Text
- uploadArchive :: CargoUploadBody -> ByteString
- uploadMetadata :: CargoUploadBody -> Value
- encodeUpload :: Value -> ByteString -> Either ParseError LByteString
Documentation
data CargoUploadBody Source #
The decoded claims and archive remain paired with one fully consumed native body.
Instances
| Show CargoUploadBody Source # | |
Defined in Ecluse.Core.Registry.Cargo.Publish.Body Methods showsPrec :: Int -> CargoUploadBody -> ShowS # show :: CargoUploadBody -> String # showList :: [CargoUploadBody] -> ShowS # | |
| Eq CargoUploadBody Source # | |
Defined in Ecluse.Core.Registry.Cargo.Publish.Body Methods (==) :: CargoUploadBody -> CargoUploadBody -> Bool # (/=) :: CargoUploadBody -> CargoUploadBody -> Bool # | |
decodeUpload :: Limits -> ByteString -> Either ParseError CargoUploadBody Source #
Decode strict native framing and JSON under the configured request and metadata bounds.
readUpload :: Limits -> (Int -> IO ()) -> ByteString -> IO (Either ParseError (CargoUploadBody, Int)) Source #
Charge the JSON tree before decoding and return that reservation for archive work. The caller separately reserves the original body.
uploadName :: CargoUploadBody -> Text Source #
Preserve the declared published spelling for archive agreement.
uploadVersion :: CargoUploadBody -> Text Source #
Preserve the declared raw native version, including build metadata.
uploadArchive :: CargoUploadBody -> ByteString Source #
These bytes are a slice of the validated original body.
uploadMetadata :: CargoUploadBody -> Value Source #
Resolver claims retain the reservation acquired before JSON decoding.
encodeUpload :: Value -> ByteString -> Either ParseError LByteString Source #
Encode native uint32 framing without changing either the JSON value or verified archive bytes.