hwormhole-0.2.0.0: magic-wormhole client

Safe HaskellNone
LanguageHaskell2010

Transit.Internal.FileTransfer

Description

 
Synopsis

Documentation

sendFile :: EncryptedConnection -> RelayEndpoint -> AppID -> FilePath -> IO (Either Error ()) Source #

Given the magic-wormhole session, appid, password, a function to print a helpful message on the command the receiver needs to type (simplest would be just a putStrLn) and the path on the disk of the sender of the file that needs to be sent, sendFile sends it via the wormhole securely. The receiver, on successfully receiving the file, would compute a sha256 sum of the encrypted file and sends it across to the sender, along with an acknowledgement, which the sender can verify.

receiveFile :: EncryptedConnection -> RelayEndpoint -> AppID -> TransitMsg -> IO (Either Error ()) Source #

Receive a file or directory via the established MagicWormhole connection

data MessageType Source #

Transfer type

Constructors

TMsg Text

Text message transfer

TFile FilePath

File or Directory transfer

Instances
Eq MessageType Source # 
Instance details

Defined in Transit.Internal.FileTransfer

Methods

(==) :: MessageType -> MessageType -> Bool

(/=) :: MessageType -> MessageType -> Bool

Show MessageType Source # 
Instance details

Defined in Transit.Internal.FileTransfer

Methods

showsPrec :: Int -> MessageType -> ShowS

show :: MessageType -> String

showList :: [MessageType] -> ShowS