Safe Haskell | None |
---|---|
Language | Haskell2010 |
Represent and work with Tahoe-LAFS storage service announcements.
A storage service announcement includes information about how to find and authenticate a storage service. They are often exchanged using a pubsub system orchestrated by an "introducer". Here, we currently support only reading them from a yaml or json file.
Synopsis
- data URI = URI {}
- data URIAuth = URIAuth {
- uriUserInfo :: String
- uriRegName :: String
- uriPort :: String
- type StorageServerID = Text
- data StorageServerAnnouncement = StorageServerAnnouncement {}
- newtype Announcements = Announcements (Map StorageServerID StorageServerAnnouncement)
- greatBlackSwampURIs :: StorageServerAnnouncement -> Maybe URI
- parseURI' :: Text -> Maybe URI
Documentation
Instances
Eq URI | |
Data URI | |
Defined in Network.URI gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URI -> c URI # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URI # dataTypeOf :: URI -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URI) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URI) # gmapT :: (forall b. Data b => b -> b) -> URI -> URI # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r # gmapQ :: (forall d. Data d => d -> u) -> URI -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> URI -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> URI -> m URI # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI # | |
Ord URI | |
Show URI | |
Generic URI | |
NFData URI | |
Defined in Network.URI | |
Lift URI | |
type Rep URI | |
Defined in Network.URI type Rep URI = D1 ('MetaData "URI" "Network.URI" "network-uri-2.6.4.2-53bce4a854294427cf4b8907cb1c5206a5ffec17f61cc081ae0091c30dfa0cdb" 'False) (C1 ('MetaCons "URI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "uriScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriAuthority") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URIAuth))) :*: (S1 ('MetaSel ('Just "uriPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriFragment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))) |
URIAuth | |
|
Instances
Eq URIAuth | |
Data URIAuth | |
Defined in Network.URI gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URIAuth -> c URIAuth # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URIAuth # toConstr :: URIAuth -> Constr # dataTypeOf :: URIAuth -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URIAuth) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URIAuth) # gmapT :: (forall b. Data b => b -> b) -> URIAuth -> URIAuth # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URIAuth -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URIAuth -> r # gmapQ :: (forall d. Data d => d -> u) -> URIAuth -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> URIAuth -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> URIAuth -> m URIAuth # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URIAuth -> m URIAuth # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URIAuth -> m URIAuth # | |
Ord URIAuth | |
Show URIAuth | |
Generic URIAuth | |
NFData URIAuth | |
Defined in Network.URI | |
Lift URIAuth | |
type Rep URIAuth | |
Defined in Network.URI type Rep URIAuth = D1 ('MetaData "URIAuth" "Network.URI" "network-uri-2.6.4.2-53bce4a854294427cf4b8907cb1c5206a5ffec17f61cc081ae0091c30dfa0cdb" 'False) (C1 ('MetaCons "URIAuth" 'PrefixI 'True) (S1 ('MetaSel ('Just "uriUserInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriRegName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriPort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
type StorageServerID = Text Source #
The unique identifier for a particular storage server, conventionally the lowercase base32 encoding of some public key controlled by the server.
data StorageServerAnnouncement Source #
An announcement from a storage server about its storage service.
Instances
newtype Announcements Source #
A map of storage server announcements keyed on the unique server identifier.
Instances
Eq Announcements Source # | |
Defined in Tahoe.Announcement (==) :: Announcements -> Announcements -> Bool # (/=) :: Announcements -> Announcements -> Bool # | |
Show Announcements Source # | |
Defined in Tahoe.Announcement showsPrec :: Int -> Announcements -> ShowS # show :: Announcements -> String # showList :: [Announcements] -> ShowS # | |
FromJSON Announcements Source # | |
Defined in Tahoe.Announcement parseJSON :: Value -> Parser Announcements parseJSONList :: Value -> Parser [Announcements] | |
ToJSON Announcements Source # | |
Defined in Tahoe.Announcement toJSON :: Announcements -> Value toEncoding :: Announcements -> Encoding toJSONList :: [Announcements] -> Value toEncodingList :: [Announcements] -> Encoding |
greatBlackSwampURIs :: StorageServerAnnouncement -> Maybe URI Source #
If possible, get the URI of a Great Black Swamp server from an announcement.
parseURI' :: Text -> Maybe URI Source #
Parse a Tahoe-LAFS fURL. For example:
pb:/gnuer2axzoq3ggnn7gjoybmfqsjvaow3@tcp:localhost:46185sxytycucj5eeunlx6modfazq5byp2hpb
This *does not* parse NURLs which are the expected way that GBS locations will be communicated.
See https://whetstone.private.storage/privatestorage/gbs-downloader/-/issues/6