Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libs/dns-util/src/Wire/Network/DNS/Effect.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
module Wire.Network.DNS.Effect where

import Imports
import Network.DNS (Domain)
import Network.DNS (Domain, Resolver)
import qualified Network.DNS as DNS
import Polysemy
import Wire.Network.DNS.SRV
Expand All @@ -34,3 +34,7 @@ runDNSLookupDefault =
rs <- DNS.makeResolvSeed DNS.defaultResolvConf
DNS.withResolver rs $ \resolver ->
interpretResponse <$> DNS.lookupSRV resolver domain

runDNSLookupWithResolver :: Member (Embed IO) r => Resolver -> Sem (DNSLookup ': r) a -> Sem r a
runDNSLookupWithResolver resolver =
interpret $ \(LookupSRV domain) -> embed (interpretResponse <$> DNS.lookupSRV resolver domain)