module Network.DNS.Cache.Types (
Key
, Prio
, Value(..)
, Entry
, Result(..)
, TTL
, HostAddress
, Domain
, DNSError(..)
) where
import Data.Array.Unboxed (UArray)
import Data.ByteString.Short (ShortByteString)
import Data.IORef (IORef)
import Data.Time (UTCTime)
import Network.DNS (Domain, DNSError(..))
import Network.Socket (HostAddress)
type Key = ShortByteString
type Prio = UTCTime
data Value = Value (UArray Int HostAddress) (IORef Int)
instance Show Value where
show (Value a _) = show a
type TTL = Int
data Result =
Hit HostAddress
| Resolved HostAddress
| Numeric HostAddress
deriving (Eq,Show)
type Entry = Either DNSError Value