| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Simplex.FileTransfer.Transport
Documentation
xftpClientHandshakeStub :: c 'TClient -> Maybe KeyPairX25519 -> KeyHash -> VersionRangeXFTP -> Bool -> Maybe (ServiceCredentials, KeyPairEd25519) -> ExceptT TransportError IO (THandle XFTPVersion c 'TClient) Source #
xftpALPNv1 :: ALPN Source #
data XFTPClientHandshake Source #
Constructors
| XFTPClientHandshake | |
Fields
| |
Instances
| Encoding XFTPClientHandshake Source # | |
Defined in Simplex.FileTransfer.Transport Methods smpEncode :: XFTPClientHandshake -> ByteString Source # smpDecode :: ByteString -> Either String XFTPClientHandshake Source # smpP :: Parser XFTPClientHandshake Source # | |
data XFTPServerHandshake Source #
Constructors
| XFTPServerHandshake | |
Fields
| |
Instances
| Encoding XFTPServerHandshake Source # | |
Defined in Simplex.FileTransfer.Transport Methods smpEncode :: XFTPServerHandshake -> ByteString Source # smpDecode :: ByteString -> Either String XFTPServerHandshake Source # smpP :: Parser XFTPServerHandshake Source # | |
data XFTPClientHello Source #
Constructors
| XFTPClientHello | |
Fields
| |
Instances
| Encoding XFTPClientHello Source # | |
Defined in Simplex.FileTransfer.Transport Methods smpEncode :: XFTPClientHello -> ByteString Source # smpDecode :: ByteString -> Either String XFTPClientHello Source # smpP :: Parser XFTPClientHello Source # | |
type THandleXFTP (c :: TransportPeer -> Type) (p :: TransportPeer) = THandle XFTPVersion c p Source #
type THandleParamsXFTP (p :: TransportPeer) = THandleParams XFTPVersion p Source #
type VersionXFTP = Version XFTPVersion Source #
data XFTPVersion Source #
Instances
pattern VersionXFTP :: Word16 -> VersionXFTP Source #
data XFTPErrorType Source #
Constructors
| BLOCK | incorrect block format, encoding or signature size |
| SESSION | incorrect SMP session ID (TLS Finished message / tls-unique binding RFC5929) |
| HANDSHAKE | incorrect handshake command |
| CMD | SMP command is unknown or has invalid syntax |
Fields | |
| AUTH | command authorization error - bad signature or non-existing SMP queue |
| BLOCKED | command with the entity that was blocked |
Fields | |
| SIZE | incorrent file size |
| QUOTA | storage quota exceeded |
| DIGEST | incorrent file digest |
| CRYPTO | file encryption/decryption failed |
| NO_FILE | no expected file body in request/response or no file on the server |
| HAS_FILE | unexpected file body |
| FILE_IO | file IO error |
| TIMEOUT | file sending or receiving timeout |
| INTERNAL | internal server error |
| DUPLICATE_ | used internally, never returned by the server (to be removed) |
Instances
| FromJSON XFTPErrorType Source # | |||||||||
Defined in Simplex.FileTransfer.Transport Methods parseJSON :: Value -> Parser XFTPErrorType parseJSONList :: Value -> Parser [XFTPErrorType] omittedField :: Maybe XFTPErrorType | |||||||||
| ToJSON XFTPErrorType Source # | |||||||||
Defined in Simplex.FileTransfer.Transport Methods toJSON :: XFTPErrorType -> Value toEncoding :: XFTPErrorType -> Encoding toJSONList :: [XFTPErrorType] -> Value toEncodingList :: [XFTPErrorType] -> Encoding omitField :: XFTPErrorType -> Bool | |||||||||
| Show XFTPErrorType Source # | |||||||||
Defined in Simplex.FileTransfer.Transport Methods showsPrec :: Int -> XFTPErrorType -> ShowS show :: XFTPErrorType -> String showList :: [XFTPErrorType] -> ShowS | |||||||||
| Eq XFTPErrorType Source # | |||||||||
Defined in Simplex.FileTransfer.Transport | |||||||||
| Encoding XFTPErrorType Source # | |||||||||
Defined in Simplex.FileTransfer.Transport Methods smpEncode :: XFTPErrorType -> ByteString Source # smpDecode :: ByteString -> Either String XFTPErrorType Source # smpP :: Parser XFTPErrorType Source # | |||||||||
| StrEncoding XFTPErrorType Source # | |||||||||
Defined in Simplex.FileTransfer.Transport Methods strEncode :: XFTPErrorType -> ByteString Source # strDecode :: ByteString -> Either String XFTPErrorType Source # strP :: Parser XFTPErrorType Source # | |||||||||
| Protocol XFTPVersion XFTPErrorType FileResponse Source # | |||||||||
Defined in Simplex.FileTransfer.Protocol Associated Types
Methods protocolClientHandshake :: Transport c => c 'TClient -> Maybe KeyPairX25519 -> KeyHash -> VersionRange XFTPVersion -> Bool -> Maybe (ServiceCredentials, KeyPairEd25519) -> ExceptT TransportError IO (THandle XFTPVersion c 'TClient) Source # useServiceAuth :: ProtoCommand FileResponse -> Bool Source # protocolPing :: ProtoCommand FileResponse Source # protocolError :: FileResponse -> Maybe XFTPErrorType 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 # | |||||||||
| ProtocolEncoding XFTPVersion XFTPErrorType FileResponse Source # | |||||||||
Defined in Simplex.FileTransfer.Protocol Associated Types
Methods encodeProtocol :: Version XFTPVersion -> FileResponse -> ByteString Source # protocolP :: Version XFTPVersion -> Tag FileResponse -> Parser FileResponse Source # fromProtocolError :: ProtocolErrorType -> XFTPErrorType Source # checkCredentials :: Maybe TAuthorizations -> EntityId -> FileResponse -> Either XFTPErrorType FileResponse Source # | |||||||||
| 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 # | |||||||||
data XFTPRcvChunkSpec Source #
Constructors
| XFTPRcvChunkSpec | |
Fields
| |
Instances
| Show XFTPRcvChunkSpec Source # | |
Defined in Simplex.FileTransfer.Transport Methods showsPrec :: Int -> XFTPRcvChunkSpec -> ShowS show :: XFTPRcvChunkSpec -> String showList :: [XFTPRcvChunkSpec] -> ShowS | |
data ReceiveFileError Source #
receiveFile :: (Int -> IO ByteString) -> XFTPRcvChunkSpec -> ExceptT XFTPErrorType IO () Source #
sendEncFile :: Handle -> (Builder -> IO ()) -> SbState -> Word32 -> IO () Source #
receiveEncFile :: (Int -> IO ByteString) -> SbState -> XFTPRcvChunkSpec -> ExceptT XFTPErrorType IO () Source #
receiveSbFile :: (Int -> IO ByteString) -> Handle -> SbState -> Word32 -> IO (Either ReceiveFileError ()) Source #