bluesky-tools-0.2.2.0: Tools for interacting with Bluesky / AT Protocol
Safe HaskellSafe-Inferred
LanguageGHC2021

Bluesky.Handle

Synopsis

Documentation

data Handle Source #

Instances

Instances details
Show Handle Source # 
Instance details

Defined in Bluesky.Handle

Eq Handle Source # 
Instance details

Defined in Bluesky.Handle

Methods

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

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

Ord Handle Source # 
Instance details

Defined in Bluesky.Handle

FromHttpApiData Handle Source # 
Instance details

Defined in Bluesky.Handle

validTld :: Handle -> Bool Source #

See "Additonal Non-Syntax Restrictions" in the spec

resolveViaDns :: HasCallStack => Handle -> IO (Maybe Did) Source #

Returns Nothing in ordinary cases where this handle can't be resolved by DNS. May raise an exception if either the handle has an invalid TLD or something goes wrong with DNS resolution.

Note that this handle shouldn't be considered valid for this DID until you've looked up the associated DID document and checked it appears there.

resolveViaHttp :: HasCallStack => Manager -> Handle -> IO (Maybe Did) Source #

Returns Nothing when the expected hostname reports 404 for the HTTP resolution endpoint. May raise an exception if either the handle has an invalid TLD or there's no HTTP server at the expected domain at all.

Note that this handle shouldn't be considered valid for this DID until you've looked up the associated DID document and checked it appears there.

resolveViaBoth :: HasCallStack => Manager -> Handle -> IO (Maybe Did) Source #

If either resolveViaDns or resolveViaHttp return a Did, return that Did. Otherwise, if one or both of them raised an exception, reraise it (or them, via BothFailed). (Otherwise, return Nothing).

data BothFailed Source #

Raised by resolveViaBoth when both methods raise exceptions.

resolveVerify :: HasCallStack => Manager -> Handle -> IO (Maybe Did) Source #

Also fetches the DID document and checks that the handle is listed there. Raises an error if not.