module App.RR where type InputParameter = { valid :: Boolean , value :: String } type RecordType = String type RecordValue = String type RecordDomain = String -- These should be integers, but I use these values in user inputs. type TTL = String type Weight = String type Priority = String type Port = String type Protocol = String type RRId = Int type Modified = Boolean type Valid = Boolean type RecordBase l = { t :: RecordType , id :: RRId , modified :: Boolean , valid :: Boolean , ttl :: TTL , domain :: RecordDomain , value :: RecordValue | l } -- CNAME A AAAA NS TXT type SimpleRR l = RecordBase (|l) type MXRR l = RecordBase ( priority :: Priority | l) type SRVRR l = RecordBase ( priority :: Priority , protocol :: Protocol , weight :: Weight , port :: Port | l) type SOARR l = RecordBase ( mname :: String , rname :: String , serial :: String -- Int , refresh :: String -- Int , retry :: String -- Int , expire :: String -- Int , minttl :: String -- Int | l) defaultResourceA :: SimpleRR () defaultResourceA = { id: 0, t: "A", modified: false, valid: true , ttl: "200", domain: "www", value: "192.168.10.2" } defaultResourceMX :: MXRR () defaultResourceMX = { id: 0, t: "MX", modified: false, valid: true , ttl: "500", priority: "10", domain: "mail", value: "www" } defaultResourceSRV :: SRVRR () -- RRId Modified Valid Priority Protocol Weight Port TTL Domain Value defaultResourceSRV = { id: 0, t: "SRV", modified: false, valid: true , priority: "10", protocol: "_tcp", weight: "100" , port: "80", ttl: "200" , domain: "_sip._tcp.example.com.", value: "sip.example.com." }