Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.GRPC.Common.Compression
Description
Public Compression
API
Intended for qualified import.
import Network.GRPC.Common.Compression (Compression(..)) import Network.GRPC.Common.Compression qualified as Compr
Synopsis
- data Compression = Compression {}
- data CompressionId
- gzip :: Compression
- allSupportedCompression :: NonEmpty Compression
- data Negotation = Negotation {}
- getSupported :: Negotation -> CompressionId -> Maybe Compression
- none :: Negotation
- chooseFirst :: NonEmpty Compression -> Negotation
- only :: Compression -> Negotation
- insist :: Compression -> Negotation
Definition
data Compression #
Constructors
Compression | |
Fields
|
Instances
Show Compression | |
Defined in Network.GRPC.Spec.Compression Methods showsPrec :: Int -> Compression -> ShowS # show :: Compression -> String # showList :: [Compression] -> ShowS # |
data CompressionId #
Instances
Standard compression schemes
gzip :: Compression #
Negotation
data Negotation Source #
Compression negotation
Constructors
Negotation | |
Fields
|
Instances
Default Negotation Source # | |
Defined in Network.GRPC.Common.Compression Methods def :: Negotation # |
getSupported :: Negotation -> CompressionId -> Maybe Compression Source #
Map CompressionId
to Compression
for supported algorithms
Specific negotation strategies
none :: Negotation Source #
Disable all compression
chooseFirst :: NonEmpty Compression -> Negotation Source #
Choose the first algorithm that appears in the list of peer supported
Precondition: the list should include the identity.
only :: Compression -> Negotation Source #
Only use the given algorithm, if the peer supports it
insist :: Compression -> Negotation Source #
Insist on the specified algorithm, no matter what the peer offers
This is dangerous: if the peer does not support the specified algorithm, it will be unable to decompress any messages. Primarily used for testing.
See also only
.