wire-api-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Wire.API.ServantProto

Synopsis

Documentation

data Proto Source #

Type to tell servant that it should unrender request body or render response body with Protobuf

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.

class ToProto a where Source #

Methods

toProto :: a -> ByteString Source #

Instances

Instances details
ToProto QualifiedNewOtrMessage Source # 
Instance details

Defined in Wire.API.Message

data RawProto a Source #

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.

Constructors

RawProto 

Fields

Instances

Instances details
ToSchema a => ToSchema (RawProto a) Source # 
Instance details

Defined in Wire.API.ServantProto

FromProto a => FromProto (RawProto a) Source # 
Instance details

Defined in Wire.API.ServantProto