Start to add support for json marshalling

This commit is contained in:
Miek Gieben 2013-01-24 21:13:37 +01:00
parent ababac6b57
commit be7b4d5873
2 changed files with 10 additions and 0 deletions

9
marshal.go Normal file
View File

@ -0,0 +1,9 @@
package dns
// UnmarshalJSON(data []byte) (err error)
func (rr *A) MarshalJSON() ([]byte, error) {
// b, _ := json.Marshal(rr.Header())
b := []byte(`"` + rr.A.String() + `"`)
return b, nil
}

View File

@ -669,6 +669,7 @@ func (rr *AAAA) Len() int {
return rr.Hdr.Len() + net.IPv6len
}
type LOC struct {
Hdr RR_Header
Version uint8