Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functionality related to acting as a client for the Great Black Swamp protocol.
Synopsis
- https :: String -> Int -> BaseUrl
- managerSettingsForService :: Text -> Text -> ManagerSettings
- newGBSManager :: MonadIO m => [Char] -> String -> m Manager
- data DownloadError
- data DiscoverError
- type LookupServer m = StorageServerAnnouncement -> m (Either LookupError StorageServer)
- data LookupError
- data DeserializeError = UnknownDeserializeError
- type GetShareNumbers = String -> ClientM (CBORSet ShareNumber)
- type ReadShare = String -> ShareNumber -> Maybe [ByteRange] -> ClientM ByteString
- mkWrapper :: GetShareNumbers -> ReadShare -> Manager -> [Char] -> Int -> StorageServer
- makeServer :: MonadIO m => GetShareNumbers -> ReadShare -> URI -> m (Either LookupError StorageServer)
- announcementToStorageServer :: MonadIO m => GetShareNumbers -> ReadShare -> StorageServerAnnouncement -> m (Either LookupError StorageServer)
Documentation
managerSettingsForService :: Text -> Text -> ManagerSettings Source #
Make an HTTPS manager for the given SPKI hash and swissnum.
The SPKI hash is _not_ used to authenticate the server! See https://whetstone.private.storage/privatestorage/tahoe-great-black-swamp/-/issues/27
newGBSManager :: MonadIO m => [Char] -> String -> m Manager Source #
Make a manager suitable for use with a Great Black Swamp server.
data DownloadError Source #
An unrecoverable problem arose while attempting to download and/or read some application data.
NoConfiguredServers | The configuration included no candidate servers from which to download. |
NoReachableServers [DiscoverError] | Across all of the configured servers, none were actually connectable. |
NotEnoughShares | Across all of the configured servers, fewer than the required number of shares were found. XXX Could split this into the different cases - did not locate enough shares, did not download enough shares, did not verify enough shares |
NotEnoughDecodedShares | Across all of the shares that we could download, fewer than the required number could actually be decoded. |
ShareDecodingFailed | Enough syntactically valid shares were recovered but they could not be interpreted. |
NoServers | An attempt was made to download a share but no servers were given for the download. |
ShareDownloadError String | An error occurred during share download. |
Instances
Eq DownloadError Source # | |
Defined in Tahoe.Download.Internal.Client (==) :: DownloadError -> DownloadError -> Bool # (/=) :: DownloadError -> DownloadError -> Bool # | |
Ord DownloadError Source # | |
Defined in Tahoe.Download.Internal.Client compare :: DownloadError -> DownloadError -> Ordering # (<) :: DownloadError -> DownloadError -> Bool # (<=) :: DownloadError -> DownloadError -> Bool # (>) :: DownloadError -> DownloadError -> Bool # (>=) :: DownloadError -> DownloadError -> Bool # max :: DownloadError -> DownloadError -> DownloadError # min :: DownloadError -> DownloadError -> DownloadError # | |
Show DownloadError Source # | |
Defined in Tahoe.Download.Internal.Client showsPrec :: Int -> DownloadError -> ShowS # show :: DownloadError -> String # showList :: [DownloadError] -> ShowS # |
data DiscoverError Source #
A problem arose while attempting to discover the shares held on a particular server.
StorageServerLocationUnknown | An announcement did not include a location for a connection attempt. |
StorageServerLocationUnsupported | An announcement included a location we could not interpret. |
StorageServerUnreachable LookupError | |
StorageServerCommunicationError String |
Instances
Eq DiscoverError Source # | |
Defined in Tahoe.Download.Internal.Client (==) :: DiscoverError -> DiscoverError -> Bool # (/=) :: DiscoverError -> DiscoverError -> Bool # | |
Ord DiscoverError Source # | |
Defined in Tahoe.Download.Internal.Client compare :: DiscoverError -> DiscoverError -> Ordering # (<) :: DiscoverError -> DiscoverError -> Bool # (<=) :: DiscoverError -> DiscoverError -> Bool # (>) :: DiscoverError -> DiscoverError -> Bool # (>=) :: DiscoverError -> DiscoverError -> Bool # max :: DiscoverError -> DiscoverError -> DiscoverError # min :: DiscoverError -> DiscoverError -> DiscoverError # | |
Show DiscoverError Source # | |
Defined in Tahoe.Download.Internal.Client showsPrec :: Int -> DiscoverError -> ShowS # show :: DiscoverError -> String # showList :: [DiscoverError] -> ShowS # |
type LookupServer m = StorageServerAnnouncement -> m (Either LookupError StorageServer) Source #
The type of a function that can produce a concrete StorageServer from that server's announcement.
data LookupError Source #
There was a problem while trying to look up a server from its announcement.
URIParseError StorageServerAnnouncement | The server's announced URI was unparseable. |
PortParseError String | The port integer in the server's URI was unparseable. |
AnnouncementStructureUnmatched | The structure of the server's URI was unparseable. |
Instances
Eq LookupError Source # | |
Defined in Tahoe.Download.Internal.Client (==) :: LookupError -> LookupError -> Bool # (/=) :: LookupError -> LookupError -> Bool # | |
Ord LookupError Source # | |
Defined in Tahoe.Download.Internal.Client compare :: LookupError -> LookupError -> Ordering # (<) :: LookupError -> LookupError -> Bool # (<=) :: LookupError -> LookupError -> Bool # (>) :: LookupError -> LookupError -> Bool # (>=) :: LookupError -> LookupError -> Bool # max :: LookupError -> LookupError -> LookupError # min :: LookupError -> LookupError -> LookupError # | |
Show LookupError Source # | |
Defined in Tahoe.Download.Internal.Client showsPrec :: Int -> LookupError -> ShowS # show :: LookupError -> String # showList :: [LookupError] -> ShowS # |
data DeserializeError Source #
A problem was encountered attempting to deserialize bytes to a structured representation of some value.
type GetShareNumbers = String -> ClientM (CBORSet ShareNumber) Source #
mkWrapper :: GetShareNumbers -> ReadShare -> Manager -> [Char] -> Int -> StorageServer Source #
Create a StorageServer that will speak Great Black Swamp using the given manager to the server at the given host/port.
makeServer :: MonadIO m => GetShareNumbers -> ReadShare -> URI -> m (Either LookupError StorageServer) Source #
If possible, populate a StorageServer with functions for operating on data on the server at the given URI.
announcementToStorageServer :: MonadIO m => GetShareNumbers -> ReadShare -> StorageServerAnnouncement -> m (Either LookupError StorageServer) Source #