| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Simplex.FileTransfer.Protocol
Synopsis
- xftpBlockSize :: Int
- data FileParty
- data SFileParty (a :: FileParty) where
- data AFileParty = FilePartyI p => AFP (SFileParty p)
- toFileParty :: forall (p :: FileParty). SFileParty p -> FileParty
- aFileParty :: FileParty -> AFileParty
- class FilePartyI (p :: FileParty) where
- sFileParty :: SFileParty p
- data FileCommandTag (p :: FileParty) where
- data FileCmdTag = FilePartyI p => FCT (SFileParty p) (FileCommandTag p)
- data FileCommand (p :: FileParty) where
- FNEW :: FileInfo -> NonEmpty RcvPublicAuthKey -> Maybe BasicAuth -> FileCommand 'FSender
- FADD :: NonEmpty RcvPublicAuthKey -> FileCommand 'FSender
- FPUT :: FileCommand 'FSender
- FDEL :: FileCommand 'FSender
- FGET :: RcvPublicDhKey -> FileCommand 'FRecipient
- FACK :: FileCommand 'FRecipient
- PING :: FileCommand 'FRecipient
- data FileCmd = FilePartyI p => FileCmd (SFileParty p) (FileCommand p)
- data FileInfo = FileInfo {
- sndKey :: SndPublicAuthKey
- size :: Word32
- digest :: ByteString
- type XFTPFileId = EntityId
- data FileResponseTag
- data FileResponse
- = FRSndIds SenderId (NonEmpty RecipientId)
- | FRRcvIds (NonEmpty RecipientId)
- | FRFile RcvPublicDhKey CbNonce
- | FROk
- | FRErr XFTPErrorType
- | FRPong
- checkParty :: forall t (p :: FileParty) (p' :: FileParty). (FilePartyI p, FilePartyI p') => t p' -> Either String (t p)
- checkParty' :: forall t (p :: FileParty) (p' :: FileParty). (FilePartyI p, FilePartyI p') => t p' -> Maybe (t p)
- xftpEncodeAuthTransmission :: ProtocolEncoding XFTPVersion XFTPErrorType c => THandleParams XFTPVersion 'TClient -> APrivateAuthKey -> Transmission c -> Either TransportError ByteString
- xftpEncodeTransmission :: forall c (p :: TransportPeer). ProtocolEncoding XFTPVersion XFTPErrorType c => THandleParams XFTPVersion p -> Transmission c -> Either TransportError ByteString
- xftpEncodeBatch1 :: SentRawTransmission -> Either TransportError ByteString
- xftpDecodeTServer :: THandleParams XFTPVersion 'TServer -> ByteString -> Either XFTPErrorType (SignedTransmissionOrError XFTPErrorType FileCmd)
- xftpDecodeTClient :: THandleParams XFTPVersion 'TClient -> ByteString -> Either XFTPErrorType (Transmission (Either XFTPErrorType FileResponse))
- xftpDecodeTransmission :: forall (p :: TransportPeer) r. (THandleParams XFTPVersion p -> Either TransportError RawTransmission -> r) -> THandleParams XFTPVersion p -> ByteString -> Either XFTPErrorType r
Documentation
xftpBlockSize :: Int Source #
File protocol clients
Constructors
| FRecipient | |
| FSender |
Instances
| FromJSON FileParty Source # | |
Defined in Simplex.FileTransfer.Protocol Methods parseJSON :: Value -> Parser FileParty parseJSONList :: Value -> Parser [FileParty] omittedField :: Maybe FileParty | |
| ToJSON FileParty Source # | |
Defined in Simplex.FileTransfer.Protocol Methods toEncoding :: FileParty -> Encoding toJSONList :: [FileParty] -> Value toEncodingList :: [FileParty] -> Encoding | |
| Show FileParty Source # | |
| Eq FileParty Source # | |
| TestEquality SFileParty Source # | |
Defined in Simplex.FileTransfer.Protocol Methods testEquality :: forall (a :: FileParty) (b :: FileParty). SFileParty a -> SFileParty b -> Maybe (a :~: b) | |
data SFileParty (a :: FileParty) where Source #
Constructors
| SFRecipient :: SFileParty 'FRecipient | |
| SFSender :: SFileParty 'FSender |
Instances
| TestEquality SFileParty Source # | |
Defined in Simplex.FileTransfer.Protocol Methods testEquality :: forall (a :: FileParty) (b :: FileParty). SFileParty a -> SFileParty b -> Maybe (a :~: b) | |
| Show (SFileParty p) Source # | |
Defined in Simplex.FileTransfer.Protocol Methods showsPrec :: Int -> SFileParty p -> ShowS show :: SFileParty p -> String showList :: [SFileParty p] -> ShowS | |
| Eq (SFileParty p) Source # | |
Defined in Simplex.FileTransfer.Protocol | |
data AFileParty Source #
Constructors
| FilePartyI p => AFP (SFileParty p) |
toFileParty :: forall (p :: FileParty). SFileParty p -> FileParty Source #
aFileParty :: FileParty -> AFileParty Source #
class FilePartyI (p :: FileParty) where Source #
Methods
sFileParty :: SFileParty p Source #
Instances
| FilePartyI 'FRecipient Source # | |
Defined in Simplex.FileTransfer.Protocol Methods | |
| FilePartyI 'FSender Source # | |
Defined in Simplex.FileTransfer.Protocol Methods | |
data FileCommandTag (p :: FileParty) where Source #
Constructors
| FNEW_ :: FileCommandTag 'FSender | |
| FADD_ :: FileCommandTag 'FSender | |
| FPUT_ :: FileCommandTag 'FSender | |
| FDEL_ :: FileCommandTag 'FSender | |
| FGET_ :: FileCommandTag 'FRecipient | |
| FACK_ :: FileCommandTag 'FRecipient | |
| PING_ :: FileCommandTag 'FRecipient |
Instances
| Show (FileCommandTag p) Source # | |
Defined in Simplex.FileTransfer.Protocol Methods showsPrec :: Int -> FileCommandTag p -> ShowS show :: FileCommandTag p -> String showList :: [FileCommandTag p] -> ShowS | |
| FilePartyI p => Encoding (FileCommandTag p) Source # | |
Defined in Simplex.FileTransfer.Protocol Methods smpEncode :: FileCommandTag p -> ByteString Source # smpDecode :: ByteString -> Either String (FileCommandTag p) Source # smpP :: Parser (FileCommandTag p) Source # | |
| FilePartyI p => ProtocolMsgTag (FileCommandTag p) Source # | |
Defined in Simplex.FileTransfer.Protocol Methods decodeTag :: ByteString -> Maybe (FileCommandTag p) Source # | |
data FileCmdTag Source #
Constructors
| FilePartyI p => FCT (SFileParty p) (FileCommandTag p) |
Instances
| Encoding FileCmdTag Source # | |
Defined in Simplex.FileTransfer.Protocol Methods smpEncode :: FileCmdTag -> ByteString Source # smpDecode :: ByteString -> Either String FileCmdTag Source # smpP :: Parser FileCmdTag Source # | |
| ProtocolMsgTag FileCmdTag Source # | |
Defined in Simplex.FileTransfer.Protocol Methods decodeTag :: ByteString -> Maybe FileCmdTag Source # | |
data FileCommand (p :: FileParty) where Source #
Constructors
| FNEW :: FileInfo -> NonEmpty RcvPublicAuthKey -> Maybe BasicAuth -> FileCommand 'FSender | |
| FADD :: NonEmpty RcvPublicAuthKey -> FileCommand 'FSender | |
| FPUT :: FileCommand 'FSender | |
| FDEL :: FileCommand 'FSender | |
| FGET :: RcvPublicDhKey -> FileCommand 'FRecipient | |
| FACK :: FileCommand 'FRecipient | |
| PING :: FileCommand 'FRecipient |
Instances
| FilePartyI p => ProtocolEncoding XFTPVersion XFTPErrorType (FileCommand p) Source # | |||||
Defined in Simplex.FileTransfer.Protocol Associated Types
Methods encodeProtocol :: Version XFTPVersion -> FileCommand p -> ByteString Source # protocolP :: Version XFTPVersion -> Tag (FileCommand p) -> Parser (FileCommand p) Source # fromProtocolError :: ProtocolErrorType -> XFTPErrorType Source # checkCredentials :: Maybe TAuthorizations -> EntityId -> FileCommand p -> Either XFTPErrorType (FileCommand p) Source # | |||||
| Show (FileCommand p) Source # | |||||
Defined in Simplex.FileTransfer.Protocol Methods showsPrec :: Int -> FileCommand p -> ShowS show :: FileCommand p -> String showList :: [FileCommand p] -> ShowS | |||||
| type Tag (FileCommand p) Source # | |||||
Defined in Simplex.FileTransfer.Protocol | |||||
Constructors
| FilePartyI p => FileCmd (SFileParty p) (FileCommand p) |
Instances
| Show FileCmd Source # | |||||
| ProtocolEncoding XFTPVersion XFTPErrorType FileCmd Source # | |||||
Defined in Simplex.FileTransfer.Protocol Associated Types
Methods encodeProtocol :: Version XFTPVersion -> FileCmd -> ByteString Source # protocolP :: Version XFTPVersion -> Tag FileCmd -> Parser FileCmd Source # fromProtocolError :: ProtocolErrorType -> XFTPErrorType Source # checkCredentials :: Maybe TAuthorizations -> EntityId -> FileCmd -> Either XFTPErrorType FileCmd Source # | |||||
| type Tag FileCmd Source # | |||||
Defined in Simplex.FileTransfer.Protocol | |||||
Constructors
| FileInfo | |
Fields
| |
type XFTPFileId = EntityId Source #
data FileResponseTag Source #
Instances
| Show FileResponseTag Source # | |
Defined in Simplex.FileTransfer.Protocol Methods showsPrec :: Int -> FileResponseTag -> ShowS show :: FileResponseTag -> String showList :: [FileResponseTag] -> ShowS | |
| Encoding FileResponseTag Source # | |
Defined in Simplex.FileTransfer.Protocol Methods smpEncode :: FileResponseTag -> ByteString Source # smpDecode :: ByteString -> Either String FileResponseTag Source # smpP :: Parser FileResponseTag Source # | |
| ProtocolMsgTag FileResponseTag Source # | |
Defined in Simplex.FileTransfer.Protocol Methods decodeTag :: ByteString -> Maybe FileResponseTag Source # | |
data FileResponse Source #
Constructors
| FRSndIds SenderId (NonEmpty RecipientId) | |
| FRRcvIds (NonEmpty RecipientId) | |
| FRFile RcvPublicDhKey CbNonce | |
| FROk | |
| FRErr XFTPErrorType | |
| FRPong |
Instances
checkParty :: forall t (p :: FileParty) (p' :: FileParty). (FilePartyI p, FilePartyI p') => t p' -> Either String (t p) Source #
checkParty' :: forall t (p :: FileParty) (p' :: FileParty). (FilePartyI p, FilePartyI p') => t p' -> Maybe (t p) Source #
xftpEncodeAuthTransmission :: ProtocolEncoding XFTPVersion XFTPErrorType c => THandleParams XFTPVersion 'TClient -> APrivateAuthKey -> Transmission c -> Either TransportError ByteString Source #
xftpEncodeTransmission :: forall c (p :: TransportPeer). ProtocolEncoding XFTPVersion XFTPErrorType c => THandleParams XFTPVersion p -> Transmission c -> Either TransportError ByteString Source #
xftpEncodeBatch1 :: SentRawTransmission -> Either TransportError ByteString Source #
xftpDecodeTServer :: THandleParams XFTPVersion 'TServer -> ByteString -> Either XFTPErrorType (SignedTransmissionOrError XFTPErrorType FileCmd) Source #
xftpDecodeTClient :: THandleParams XFTPVersion 'TClient -> ByteString -> Either XFTPErrorType (Transmission (Either XFTPErrorType FileResponse)) Source #
xftpDecodeTransmission :: forall (p :: TransportPeer) r. (THandleParams XFTPVersion p -> Either TransportError RawTransmission -> r) -> THandleParams XFTPVersion p -> ByteString -> Either XFTPErrorType r Source #