magic-wormhole-0.2.0: 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

Instances

Eq Offer Source # 

Methods

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

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

Show Offer Source # 

Methods

showsPrec :: Int -> Offer -> ShowS #

show :: Offer -> String #

showList :: [Offer] -> ShowS #

ToJSON Offer Source # 

Methods

toJSON :: Offer -> Value

toEncoding :: Offer -> Encoding

toJSONList :: [Offer] -> Value

toEncodingList :: [Offer] -> Encoding

FromJSON Offer Source # 

Methods

parseJSON :: Value -> Parser Offer

parseJSONList :: Value -> Parser [Offer]

for tests