| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Simplex.Chat.Remote.Protocol
Synopsis
- data RemoteCommand
- = RCSend {
- command :: Text
- retryNumber :: Int
- | RCRecv {
- wait :: Int
- | RCStoreFile {
- fileName :: String
- fileSize :: Word32
- fileDigest :: FileDigest
- | RCGetFile {
- file :: RemoteFile
- = RCSend {
- data RemoteResponse
- = RRChatResponse { }
- | RRChatEvent { }
- | RRFileStored {
- filePath :: String
- | RRFile {
- fileSize :: Word32
- fileDigest :: FileDigest
- | RRProtocolError { }
- data RRResult r
- resultToEither :: RRResult r -> Either ChatError r
- eitherToResult :: Either ChatError r -> RRResult r
- mkRemoteHostClient :: HTTP2Client -> HostSessKeys -> SessionCode -> FilePath -> HostAppInfo -> CM RemoteHostClient
- mkCtrlRemoteCrypto :: CtrlSessKeys -> SessionCode -> CM RemoteCrypto
- mkRemoteCrypto :: SessionCode -> TSbChainKeys -> RemoteSignatures -> IO RemoteCrypto
- closeRemoteHostClient :: RemoteHostClient -> IO ()
- remoteSend :: RemoteHostClient -> ByteString -> Int -> ExceptT RemoteProtocolError IO (Either ChatError ChatResponse)
- remoteRecv :: RemoteHostClient -> Int -> ExceptT RemoteProtocolError IO (Maybe (Either ChatError ChatEvent))
- remoteStoreFile :: RemoteHostClient -> FilePath -> FilePath -> ExceptT RemoteProtocolError IO FilePath
- remoteGetFile :: RemoteHostClient -> FilePath -> RemoteFile -> ExceptT RemoteProtocolError IO ()
- sendRemoteCommand' :: RemoteHostClient -> Maybe (Handle, Word32) -> RemoteCommand -> ExceptT RemoteProtocolError IO RemoteResponse
- sendRemoteCommand :: RemoteHostClient -> Maybe (Handle, Word32) -> RemoteCommand -> ExceptT RemoteProtocolError IO (SbKeyNonce, Int -> IO ByteString, RemoteResponse)
- badResponse :: RemoteResponse -> ExceptT RemoteProtocolError IO a
- convertJSON :: PlatformEncoding -> PlatformEncoding -> Value -> Value
- owsf2tagged :: Value -> Value
- pattern OwsfTag :: (Key, Value)
- encryptEncodeHTTP2Body :: Word32 -> SbKeyNonce -> RemoteCrypto -> LazyByteString -> ExceptT RemoteProtocolError IO Builder
- parseDecryptHTTP2Body :: HTTP2BodyChunk a => RemoteCrypto -> a -> HTTP2Body -> ExceptT RemoteProtocolError IO (SbKeyNonce, LazyByteString, Int -> IO ByteString)
Documentation
data RemoteCommand Source #
Constructors
| RCSend | |
Fields
| |
| RCRecv | |
Fields
| |
| RCStoreFile | |
Fields
| |
| RCGetFile | |
Fields
| |
Instances
| FromJSON RemoteCommand Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods parseJSON :: Value -> Parser RemoteCommand parseJSONList :: Value -> Parser [RemoteCommand] omittedField :: Maybe RemoteCommand | |
| ToJSON RemoteCommand Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods toJSON :: RemoteCommand -> Value toEncoding :: RemoteCommand -> Encoding toJSONList :: [RemoteCommand] -> Value toEncodingList :: [RemoteCommand] -> Encoding omitField :: RemoteCommand -> Bool | |
| Show RemoteCommand Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods showsPrec :: Int -> RemoteCommand -> ShowS show :: RemoteCommand -> String showList :: [RemoteCommand] -> ShowS | |
data RemoteResponse Source #
Constructors
| RRChatResponse | |
Fields | |
| RRChatEvent | |
| RRFileStored | |
Fields
| |
| RRFile | |
Fields
| |
| RRProtocolError | |
Fields | |
Instances
| FromJSON RemoteResponse Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods parseJSON :: Value -> Parser RemoteResponse parseJSONList :: Value -> Parser [RemoteResponse] omittedField :: Maybe RemoteResponse | |
| ToJSON RemoteResponse Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods toJSON :: RemoteResponse -> Value toEncoding :: RemoteResponse -> Encoding toJSONList :: [RemoteResponse] -> Value toEncodingList :: [RemoteResponse] -> Encoding omitField :: RemoteResponse -> Bool | |
| Show RemoteResponse Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods showsPrec :: Int -> RemoteResponse -> ShowS show :: RemoteResponse -> String showList :: [RemoteResponse] -> ShowS | |
Instances
| FromJSON r => FromJSON (RRResult r) Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods parseJSON :: Value -> Parser (RRResult r) parseJSONList :: Value -> Parser [RRResult r] omittedField :: Maybe (RRResult r) | |
| ToJSON r => ToJSON (RRResult r) Source # | |
Defined in Simplex.Chat.Remote.Protocol Methods toEncoding :: RRResult r -> Encoding toJSONList :: [RRResult r] -> Value toEncodingList :: [RRResult r] -> Encoding | |
| Show r => Show (RRResult r) Source # | |
resultToEither :: RRResult r -> Either ChatError r Source #
eitherToResult :: Either ChatError r -> RRResult r Source #
Client side / desktop
mkRemoteHostClient :: HTTP2Client -> HostSessKeys -> SessionCode -> FilePath -> HostAppInfo -> CM RemoteHostClient Source #
mkCtrlRemoteCrypto :: CtrlSessKeys -> SessionCode -> CM RemoteCrypto Source #
mkRemoteCrypto :: SessionCode -> TSbChainKeys -> RemoteSignatures -> IO RemoteCrypto Source #
closeRemoteHostClient :: RemoteHostClient -> IO () Source #
Commands
remoteSend :: RemoteHostClient -> ByteString -> Int -> ExceptT RemoteProtocolError IO (Either ChatError ChatResponse) Source #
remoteRecv :: RemoteHostClient -> Int -> ExceptT RemoteProtocolError IO (Maybe (Either ChatError ChatEvent)) Source #
remoteStoreFile :: RemoteHostClient -> FilePath -> FilePath -> ExceptT RemoteProtocolError IO FilePath Source #
remoteGetFile :: RemoteHostClient -> FilePath -> RemoteFile -> ExceptT RemoteProtocolError IO () Source #
sendRemoteCommand' :: RemoteHostClient -> Maybe (Handle, Word32) -> RemoteCommand -> ExceptT RemoteProtocolError IO RemoteResponse Source #
sendRemoteCommand :: RemoteHostClient -> Maybe (Handle, Word32) -> RemoteCommand -> ExceptT RemoteProtocolError IO (SbKeyNonce, Int -> IO ByteString, RemoteResponse) Source #
badResponse :: RemoteResponse -> ExceptT RemoteProtocolError IO a Source #
Transport-level wrappers
convertJSON :: PlatformEncoding -> PlatformEncoding -> Value -> Value Source #
owsf2tagged :: Value -> Value Source #
Convert swift single-field sum encoding into tagged/discriminator-field
encryptEncodeHTTP2Body :: Word32 -> SbKeyNonce -> RemoteCrypto -> LazyByteString -> ExceptT RemoteProtocolError IO Builder Source #
parseDecryptHTTP2Body :: HTTP2BodyChunk a => RemoteCrypto -> a -> HTTP2Body -> ExceptT RemoteProtocolError IO (SbKeyNonce, LazyByteString, Int -> IO ByteString) Source #
Parse and decrypt HTTP2 request/response