Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Proto
- class FromProto a where
- fromProto :: ByteString -> Either String a
- class ToProto a where
- toProto :: a -> ByteString
- data RawProto a = RawProto {
- rpRaw :: ByteString
- rpValue :: a
Documentation
Type to tell servant that it should unrender request body or render response body with Protobuf
Instances
Accept Proto Source # | |
Defined in Wire.API.ServantProto | |
FromProto a => MimeUnrender Proto a Source # | |
Defined in Wire.API.ServantProto mimeUnrender :: Proxy Proto -> ByteString -> Either String a Source # mimeUnrenderWithType :: Proxy Proto -> MediaType -> ByteString -> Either String a Source # |
class FromProto a where Source #
We do not use Decode
so we get a little freedom in
defining separate data types which match one to one with the protobuf and the
data types which we actually use in business logic. Eventually we should
think of better ways of doing this, perhaps using mu-schema or proto-lens as
it is fairly difficult to keep our custom data type, e.g. in
Wire.API.Message.Proto in sync with the proto files.
Instances
FromProto NewOtrMessage Source # | |
Defined in Wire.API.Message | |
FromProto QualifiedNewOtrMessage Source # | |
Defined in Wire.API.Message | |
FromProto a => FromProto (RawProto a) Source # | |
Defined in Wire.API.ServantProto |
class ToProto a where Source #
toProto :: a -> ByteString Source #
Instances
ToProto QualifiedNewOtrMessage Source # | |
Defined in Wire.API.Message |
This wrapper can be used to get the raw protobuf representation of a type. It is used when the protobuf is supposed to be forwarded somewhere like a federated remote, this saves us from having to re-encode it.
RawProto | |
|
Instances
ToSchema a => ToSchema (RawProto a) Source # | |
Defined in Wire.API.ServantProto declareNamedSchema :: Proxy (RawProto a) -> Declare (Definitions Schema) NamedSchema Source # | |
FromProto a => FromProto (RawProto a) Source # | |
Defined in Wire.API.ServantProto |