| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
MagicWormhole.Internal.FileTransfer
Contents
Description
Partial implementation of the Magic Wormhole file transfer protocol.
Once a connection has been made between peers (see withEncryptedConnection),
you can send an Offer to share a simple text message.
Synopsis
- data Offer
- = Message Text
- | File FilePath FileOffset
- | Directory {
- directoryMode :: DirectoryMode
- dirName :: Text
- zipSize :: Natural
- numBytes :: Natural
- numFiles :: Natural
- data DirectoryMode = ZipFileDeflated
Documentation
An offer made by a sender as part of the Magic Wormhole file transfer protocol.
Currently only supports sending simple text messages. A full version would also support sending files and directories.
Constructors
| Message Text | A simple text message. |
| File FilePath FileOffset | Offer a File with filename and size. |
| Directory | Offer a Directory |
Fields
| |
Instances
| Eq Offer Source # | |
| Show Offer Source # | |
| FromJSON Offer Source # | |
Defined in MagicWormhole.Internal.FileTransfer | |
| ToJSON Offer Source # | |
Defined in MagicWormhole.Internal.FileTransfer Methods toEncoding :: Offer -> Encoding toJSONList :: [Offer] -> Value toEncodingList :: [Offer] -> Encoding | |
for tests
data DirectoryMode Source #
Textual representation of the format in which the directory tree is encoded
Constructors
| ZipFileDeflated |
Instances
| Eq DirectoryMode Source # | |
Defined in MagicWormhole.Internal.FileTransfer | |
| Show DirectoryMode Source # | |
Defined in MagicWormhole.Internal.FileTransfer Methods showsPrec :: Int -> DirectoryMode -> ShowS show :: DirectoryMode -> String showList :: [DirectoryMode] -> ShowS | |
| FromJSON DirectoryMode Source # | |
Defined in MagicWormhole.Internal.FileTransfer | |
| ToJSON DirectoryMode Source # | |
Defined in MagicWormhole.Internal.FileTransfer Methods toJSON :: DirectoryMode -> Value toEncoding :: DirectoryMode -> Encoding toJSONList :: [DirectoryMode] -> Value toEncodingList :: [DirectoryMode] -> Encoding | |