libp2p-hs-0.1.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

Network.LibP2P.MultistreamSelect.Wire

Description

Wire format for multistream-select.

Every message is: varint-lengthpayloadn The length includes the trailing newline byte.

Synopsis

Documentation

encodeMessage :: Text -> ByteString Source #

Encode a multistream-select message (protocol ID or command). Produces: varint(len+1)encoded text0x0a

decodeMessage :: ByteString -> Either String (Text, ByteString) Source #

Decode a multistream-select message from bytes. Returns the text content (without newline) and remaining bytes.

multistreamHeader :: Text Source #

The multistream-select protocol header.

naMessage :: Text Source #

The "not available" response.