| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Runtime.Aws.S3.Conditional
Contents
Description
Conditional S3 writes, the listing that tells a missing key from a refused read, and a byte bound on the responses to both.
amazonka's generated PutObject has no If-Match or If-None-Match field, so ConditionalPut
adds the header before signing and the signature covers it. A store that ignores the header would
overwrite unconditionally, so a writer that relies on it needs a store that enforces it.
Synopsis
- data WritePrecondition
- data ConditionalPut = ConditionalPut WritePrecondition PutObject
- isWriteConflict :: Error -> Bool
- absenceListing :: Text -> Text -> ListObjectsV2
- listingProvesAbsence :: ListObjectsV2Response -> Bool
- newtype Capped a = Capped a
- newtype ResponseTooLarge = ResponseTooLarge Int
- maxCappedResponseBytes :: Int
Documentation
data WritePrecondition Source #
What a conditional write requires of the object the key holds.
Constructors
| IfAbsent | No object holds the key: |
| IfRevision ByteString | The object holds exactly this ETag: |
Instances
| Show WritePrecondition Source # | |
Defined in Ecluse.Runtime.Aws.S3.Conditional Methods showsPrec :: Int -> WritePrecondition -> ShowS # show :: WritePrecondition -> String # showList :: [WritePrecondition] -> ShowS # | |
| Eq WritePrecondition Source # | |
Defined in Ecluse.Runtime.Aws.S3.Conditional Methods (==) :: WritePrecondition -> WritePrecondition -> Bool # (/=) :: WritePrecondition -> WritePrecondition -> Bool # | |
data ConditionalPut Source #
A PutObject the store applies only while its precondition holds.
Constructors
| ConditionalPut WritePrecondition PutObject |
Instances
| AWSRequest ConditionalPut Source # | |||||
Defined in Ecluse.Runtime.Aws.S3.Conditional Associated Types
Methods request :: (Service -> Service) -> ConditionalPut -> Request ConditionalPut # response :: MonadResource m => (ByteStringLazy -> IO ByteStringLazy) -> Service -> Proxy ConditionalPut -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse ConditionalPut))) # | |||||
| type AWSResponse ConditionalPut Source # | |||||
Defined in Ecluse.Runtime.Aws.S3.Conditional | |||||
isWriteConflict :: Error -> Bool Source #
Whether the store refused a conditional write because its precondition no longer held.
absenceListing :: Text -> Text -> ListObjectsV2 Source #
The one-key listing a refused read falls back on, which needs only prefix-scoped s3:ListBucket.
listingProvesAbsence :: ListObjectsV2Response -> Bool Source #
Only a complete, empty listing proves absence. A truncated or populated one proves nothing.
Bounded responses
A request whose response body, success or error, is bounded before the generated decoder reads it. A longer one throws ResponseTooLarge.
Constructors
| Capped a |
Instances
| AWSRequest a => AWSRequest (Capped a) Source # | |||||
Defined in Ecluse.Runtime.Aws.S3.Conditional Associated Types
Methods request :: (Service -> Service) -> Capped a -> Request (Capped a) # response :: MonadResource m => (ByteStringLazy -> IO ByteStringLazy) -> Service -> Proxy (Capped a) -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse (Capped a)))) # | |||||
| type AWSResponse (Capped a) Source # | |||||
Defined in Ecluse.Runtime.Aws.S3.Conditional | |||||
newtype ResponseTooLarge Source #
A capped response passed its bound, in bytes.
Constructors
| ResponseTooLarge Int |
Instances
| Exception ResponseTooLarge Source # | |
Defined in Ecluse.Runtime.Aws.S3.Conditional Methods toException :: ResponseTooLarge -> SomeException # fromException :: SomeException -> Maybe ResponseTooLarge # | |
| Show ResponseTooLarge Source # | |
Defined in Ecluse.Runtime.Aws.S3.Conditional Methods showsPrec :: Int -> ResponseTooLarge -> ShowS # show :: ResponseTooLarge -> String # showList :: [ResponseTooLarge] -> ShowS # | |
| Eq ResponseTooLarge Source # | |
Defined in Ecluse.Runtime.Aws.S3.Conditional Methods (==) :: ResponseTooLarge -> ResponseTooLarge -> Bool # (/=) :: ResponseTooLarge -> ResponseTooLarge -> Bool # | |
maxCappedResponseBytes :: Int Source #
64 KiB: a one-key listing or an S3 error document is a few hundred bytes.