Safe Haskell | None |
---|---|
Language | Haskell2010 |
The JSON messages are derived from these Message types.
Synopsis
- data TransitMsg
- = Error Text
- | Answer Ack
- | Transit {
- abilitiesV1 :: [Ability]
- hintsV1 :: Set ConnectionHint
- newtype Ability = Ability {}
- data AbilityV1
- data Hint = Hint {}
- data ConnectionHint
- data Ack
- = FileAck Text
- | MessageAck Text
- data TransitAck = TransitAck {}
Documentation
data TransitMsg Source #
Transit, Answer and Error Message from Client to Client
Error Text | |
Answer Ack | Answer message is sent on a successful transfer |
Transit | Transit message |
|
Instances
Eq TransitMsg Source # | |
Defined in Transit.Internal.Messages (==) :: TransitMsg -> TransitMsg -> Bool (/=) :: TransitMsg -> TransitMsg -> Bool | |
Show TransitMsg Source # | |
Defined in Transit.Internal.Messages showsPrec :: Int -> TransitMsg -> ShowS show :: TransitMsg -> String showList :: [TransitMsg] -> ShowS | |
Generic TransitMsg Source # | |
Defined in Transit.Internal.Messages type Rep TransitMsg :: * -> * from :: TransitMsg -> Rep TransitMsg x to :: Rep TransitMsg x -> TransitMsg | |
FromJSON TransitMsg Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser TransitMsg parseJSONList :: Value -> Parser [TransitMsg] | |
ToJSON TransitMsg Source # | |
Defined in Transit.Internal.Messages toJSON :: TransitMsg -> Value toEncoding :: TransitMsg -> Encoding toJSONList :: [TransitMsg] -> Value toEncodingList :: [TransitMsg] -> Encoding | |
type Rep TransitMsg Source # | |
Defined in Transit.Internal.Messages type Rep TransitMsg = D1 (MetaData "TransitMsg" "Transit.Internal.Messages" "hwormhole-0.2.0.1-inplace" False) (C1 (MetaCons "Error" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :+: (C1 (MetaCons "Answer" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Ack)) :+: C1 (MetaCons "Transit" PrefixI True) (S1 (MetaSel (Just "abilitiesV1") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Ability]) :*: S1 (MetaSel (Just "hintsV1") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set ConnectionHint))))) |
A newtype specifically for generating Ability JSON messages
Instances
Eq Ability Source # | |
Show Ability Source # | |
Generic Ability Source # | |
FromJSON Ability Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser Ability parseJSONList :: Value -> Parser [Ability] | |
ToJSON Ability Source # | |
Defined in Transit.Internal.Messages toEncoding :: Ability -> Encoding toJSONList :: [Ability] -> Value toEncodingList :: [Ability] -> Encoding | |
type Rep Ability Source # | |
Defined in Transit.Internal.Messages |
Type to represent the abilities
DirectTcpV1 | Can send directly via TCP |
RelayV1 | Can relay via a relay server |
Instances
Eq AbilityV1 Source # | |
Show AbilityV1 Source # | |
Generic AbilityV1 Source # | |
FromJSON AbilityV1 Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser AbilityV1 parseJSONList :: Value -> Parser [AbilityV1] | |
ToJSON AbilityV1 Source # | |
Defined in Transit.Internal.Messages toEncoding :: AbilityV1 -> Encoding toJSONList :: [AbilityV1] -> Value toEncodingList :: [AbilityV1] -> Encoding | |
type Rep AbilityV1 Source # | |
Defined in Transit.Internal.Messages type Rep AbilityV1 = D1 (MetaData "AbilityV1" "Transit.Internal.Messages" "hwormhole-0.2.0.1-inplace" False) (C1 (MetaCons "DirectTcpV1" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RelayV1" PrefixI False) (U1 :: * -> *)) |
Hints are messages that specify ways that the client can connect to the peer.
Instances
Eq Hint Source # | |
Ord Hint Source # | |
Show Hint Source # | |
Generic Hint Source # | |
FromJSON Hint Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser Hint parseJSONList :: Value -> Parser [Hint] | |
ToJSON Hint Source # | |
Defined in Transit.Internal.Messages | |
type Rep Hint Source # | |
Defined in Transit.Internal.Messages type Rep Hint = D1 (MetaData "Hint" "Transit.Internal.Messages" "hwormhole-0.2.0.1-inplace" False) (C1 (MetaCons "Hint" PrefixI True) ((S1 (MetaSel (Just "ctype") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AbilityV1) :*: S1 (MetaSel (Just "priority") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Double)) :*: (S1 (MetaSel (Just "hostname") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "port") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word16)))) |
data ConnectionHint Source #
Connection Hint is currently a direct hint or a relay hint
Instances
Eq ConnectionHint Source # | |
Defined in Transit.Internal.Messages (==) :: ConnectionHint -> ConnectionHint -> Bool (/=) :: ConnectionHint -> ConnectionHint -> Bool | |
Ord ConnectionHint Source # | |
Defined in Transit.Internal.Messages compare :: ConnectionHint -> ConnectionHint -> Ordering (<) :: ConnectionHint -> ConnectionHint -> Bool (<=) :: ConnectionHint -> ConnectionHint -> Bool (>) :: ConnectionHint -> ConnectionHint -> Bool (>=) :: ConnectionHint -> ConnectionHint -> Bool max :: ConnectionHint -> ConnectionHint -> ConnectionHint min :: ConnectionHint -> ConnectionHint -> ConnectionHint | |
Show ConnectionHint Source # | |
Defined in Transit.Internal.Messages showsPrec :: Int -> ConnectionHint -> ShowS show :: ConnectionHint -> String showList :: [ConnectionHint] -> ShowS | |
Generic ConnectionHint Source # | |
Defined in Transit.Internal.Messages type Rep ConnectionHint :: * -> * from :: ConnectionHint -> Rep ConnectionHint x to :: Rep ConnectionHint x -> ConnectionHint | |
FromJSON ConnectionHint Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser ConnectionHint parseJSONList :: Value -> Parser [ConnectionHint] | |
ToJSON ConnectionHint Source # | |
Defined in Transit.Internal.Messages toJSON :: ConnectionHint -> Value toEncoding :: ConnectionHint -> Encoding toJSONList :: [ConnectionHint] -> Value toEncodingList :: [ConnectionHint] -> Encoding | |
type Rep ConnectionHint Source # | |
Defined in Transit.Internal.Messages type Rep ConnectionHint = D1 (MetaData "ConnectionHint" "Transit.Internal.Messages" "hwormhole-0.2.0.1-inplace" False) (C1 (MetaCons "Direct" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Hint)) :+: C1 (MetaCons "Relay" PrefixI True) (S1 (MetaSel (Just "rtype") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AbilityV1) :*: S1 (MetaSel (Just "hints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Hint]))) |
Ack message type
FileAck Text | File Ack |
MessageAck Text | Message Ack |
Instances
Eq Ack Source # | |
Show Ack Source # | |
Generic Ack Source # | |
FromJSON Ack Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser Ack parseJSONList :: Value -> Parser [Ack] | |
ToJSON Ack Source # | |
Defined in Transit.Internal.Messages | |
type Rep Ack Source # | |
Defined in Transit.Internal.Messages type Rep Ack = D1 (MetaData "Ack" "Transit.Internal.Messages" "hwormhole-0.2.0.1-inplace" False) (C1 (MetaCons "FileAck" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :+: C1 (MetaCons "MessageAck" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) |
data TransitAck Source #
Message sent by the receiver of the file to the sender
TransitAck | expected sha256 sum of the transfered file |
Instances
Eq TransitAck Source # | |
Defined in Transit.Internal.Messages (==) :: TransitAck -> TransitAck -> Bool (/=) :: TransitAck -> TransitAck -> Bool | |
Show TransitAck Source # | |
Defined in Transit.Internal.Messages showsPrec :: Int -> TransitAck -> ShowS show :: TransitAck -> String showList :: [TransitAck] -> ShowS | |
Generic TransitAck Source # | |
Defined in Transit.Internal.Messages type Rep TransitAck :: * -> * from :: TransitAck -> Rep TransitAck x to :: Rep TransitAck x -> TransitAck | |
FromJSON TransitAck Source # | |
Defined in Transit.Internal.Messages parseJSON :: Value -> Parser TransitAck parseJSONList :: Value -> Parser [TransitAck] | |
ToJSON TransitAck Source # | |
Defined in Transit.Internal.Messages toJSON :: TransitAck -> Value toEncoding :: TransitAck -> Encoding toJSONList :: [TransitAck] -> Value toEncodingList :: [TransitAck] -> Encoding | |
type Rep TransitAck Source # | |
Defined in Transit.Internal.Messages type Rep TransitAck = D1 (MetaData "TransitAck" "Transit.Internal.Messages" "hwormhole-0.2.0.1-inplace" False) (C1 (MetaCons "TransitAck" PrefixI True) (S1 (MetaSel (Just "ack") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "sha256") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) |