, Zone(zoneName)
, SomeZone(..)
, ExternalZone(..)
- , FunctionalZone(..)
+ , DynamicZone(..)
, StaticZone(..)
, fromRecords
, isInZone
Just getZone -> liftM Just getZone
Nothing -> return Nothing
-instance ZoneFinder (DomainName -> Maybe SomeZone) where
- findZone = (return .)
-
instance ZoneFinder (DomainName -> IO (Maybe SomeZone)) where
findZone = id
getRecordsForName = ezRecordsForName
-data FunctionalZone
- = FunctionalZone {
- fzName :: !DomainName
- , fzRecordNames :: ![DomainName]
- , fzRecordsForName :: !(DomainName -> [SomeRR])
+data DynamicZone
+ = DynamicZone {
+ dzName :: !DomainName
+ , dzRecords :: !(IO (Map DomainName [SomeRR]))
}
-instance Zone FunctionalZone where
- zoneName = fzName
- getRecordNames = return . fzRecordNames
- getRecordsForName = (return .) . fzRecordsForName
+instance Zone DynamicZone where
+ zoneName = dzName
+ getRecordNames = liftM M.keys . dzRecords
+ getRecordsForName = flip (fmap . (fromMaybe [] .) . M.lookup) . dzRecords
data StaticZone