dnsjson

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

dns-json-go

DNS JSON parser

dns to json

msg := new(dns.Msg)
...
dnsMsg := &DNSMsg{msg}
jsonByte, _ := dnsMsg.DNS2JSON()
log.Println(string(jsonByte))

json to dns

jsonByte = ...
...
jsonMsg := &jsondns.JSONMsg{}
json.Unmarshal(jsonByte, jsonMsg)
log.Println(jsonMsg)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSMsg

type DNSMsg struct {
	*dns.Msg
}

DNSMsg is contains dns.Msg

func (*DNSMsg) DNS2JSON

func (msg *DNSMsg) DNS2JSON() ([]byte, error)

DNS2JSON is a function dns message to json

func (*DNSMsg) JSON2DNS

func (msg *DNSMsg) JSON2DNS(jsonMsg *jsondns.JSONMsg, udpSize uint16, ednsClientNetmask uint8) (reply *dns.Msg, err error)

JSON2DNS is a function json to dns message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL