Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data DNSActions resolver exception (m :: Type -> Type) = DNSActions {
- dnsResolverResource :: ResolvConf -> m (Resource m (Either (DNSorIOError exception) resolver))
- dnsAsyncResolverResource :: ResolvConf -> m (Resource m (Either (DNSorIOError exception) resolver))
- dnsLookupWithTTL :: ResolvConf -> resolver -> Domain -> m ([DNSError], [(IP, TTL)])
- ioDNSActions :: DNSLookupType -> DNSActions Resolver IOException IO
- data DNSLookupType
- newtype Resource (m :: Type -> Type) a = Resource {
- withResource :: m (a, Resource m a)
- retryResource :: forall (m :: Type -> Type) e a. MonadDelay m => Tracer m e -> NonEmpty DiffTime -> Resource m (Either e a) -> Resource m a
- constantResource :: forall (m :: Type -> Type) a. Applicative m => a -> Resource m a
- data DNSorIOError exception
DNS based actions for local and public root providers
data DNSActions resolver exception (m :: Type -> Type) Source #
Dictionary of DNS actions vocabulary
DNSActions | |
|
DNSActions IO
ioDNSActions :: DNSLookupType -> DNSActions Resolver IOException IO Source #
IO DNSActions which resolve domain names with Resolver
.
The IPv4 and IPv6 addresses the node will be using should determine the LookupReqs so that we can avoid lookups for address types that wont be used.
It guarantees that returned TTLs are strictly greater than 0.
data DNSLookupType Source #
Instances
Show DNSLookupType Source # | |
Defined in Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions showsPrec :: Int -> DNSLookupType -> ShowS # show :: DNSLookupType -> String # showList :: [DNSLookupType] -> ShowS # |
Utils
Resource
newtype Resource (m :: Type -> Type) a Source #
Evolving resource; We use it to reinitialise the DNS library if the `etcresolv.conf` file was modified.
Note: constantResource
and retryResource
are written using a simplified approach
inspired by _"The Different Aspects of Monads and Mixins"_, by Bruno C. d S.
Oliveira, see https://www.youtube.com/watch?v=pfwP4hXM5hA.
Resource | |
|
retryResource :: forall (m :: Type -> Type) e a. MonadDelay m => Tracer m e -> NonEmpty DiffTime -> Resource m (Either e a) -> Resource m a Source #
constantResource :: forall (m :: Type -> Type) a. Applicative m => a -> Resource m a Source #
Error type
data DNSorIOError exception Source #
Instances
Exception exception => Exception (DNSorIOError exception) Source # | |
Defined in Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions toException :: DNSorIOError exception -> SomeException # fromException :: SomeException -> Maybe (DNSorIOError exception) # displayException :: DNSorIOError exception -> String # backtraceDesired :: DNSorIOError exception -> Bool # | |
Show exception => Show (DNSorIOError exception) Source # | |
Defined in Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions showsPrec :: Int -> DNSorIOError exception -> ShowS # show :: DNSorIOError exception -> String # showList :: [DNSorIOError exception] -> ShowS # |