magic-wormhole-0.3.3: Interact with Magic Wormhole

Safe HaskellNone
LanguageHaskell2010

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

Documentation

data Offer Source #

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

  • directoryMode :: DirectoryMode

    Mode. Currently always "zipfile/deflated".

  • dirName :: Text

    Directory Name.

  • zipSize :: Natural

    size of the transmitted compressed data in bytes

  • numBytes :: Natural

    estimated total size of the uncompressed directory

  • numFiles :: Natural

    number of files and directories being sent

Instances
Eq Offer Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

(==) :: Offer -> Offer -> Bool

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

Show Offer Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

showsPrec :: Int -> Offer -> ShowS

show :: Offer -> String

showList :: [Offer] -> ShowS

FromJSON Offer Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

parseJSON :: Value -> Parser Offer

parseJSONList :: Value -> Parser [Offer]

ToJSON Offer Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

toJSON :: Offer -> Value

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 # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Show DirectoryMode Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

showsPrec :: Int -> DirectoryMode -> ShowS

show :: DirectoryMode -> String

showList :: [DirectoryMode] -> ShowS

FromJSON DirectoryMode Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

parseJSON :: Value -> Parser DirectoryMode

parseJSONList :: Value -> Parser [DirectoryMode]

ToJSON DirectoryMode Source # 
Instance details

Defined in MagicWormhole.Internal.FileTransfer

Methods

toJSON :: DirectoryMode -> Value

toEncoding :: DirectoryMode -> Encoding

toJSONList :: [DirectoryMode] -> Value

toEncodingList :: [DirectoryMode] -> Encoding