entity

package
v0.0.0-...-06d884a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StringToType = map[string]uint16{
	"none":       dns.TypeNone,
	"a":          dns.TypeA,
	"ns":         dns.TypeNS,
	"md":         dns.TypeMD,
	"mf":         dns.TypeMF,
	"cname":      dns.TypeCNAME,
	"soa":        dns.TypeSOA,
	"mb":         dns.TypeMB,
	"mg":         dns.TypeMG,
	"mr":         dns.TypeMR,
	"null":       dns.TypeNULL,
	"ptr":        dns.TypePTR,
	"hinfo":      dns.TypeHINFO,
	"minfo":      dns.TypeMINFO,
	"mx":         dns.TypeMX,
	"txt":        dns.TypeTXT,
	"rp":         dns.TypeRP,
	"afsdb":      dns.TypeAFSDB,
	"x25":        dns.TypeX25,
	"isdn":       dns.TypeISDN,
	"rt":         dns.TypeRT,
	"nsapptr":    dns.TypeNSAPPTR,
	"sig":        dns.TypeSIG,
	"key":        dns.TypeKEY,
	"px":         dns.TypePX,
	"gpos":       dns.TypeGPOS,
	"aaaa":       dns.TypeAAAA,
	"loc":        dns.TypeLOC,
	"nxt":        dns.TypeNXT,
	"eid":        dns.TypeEID,
	"nimloc":     dns.TypeNIMLOC,
	"srv":        dns.TypeSRV,
	"atma":       dns.TypeATMA,
	"naptr":      dns.TypeNAPTR,
	"kx":         dns.TypeKX,
	"cert":       dns.TypeCERT,
	"dname":      dns.TypeDNAME,
	"opt":        dns.TypeOPT,
	"apl":        dns.TypeAPL,
	"ds":         dns.TypeDS,
	"sshfp":      dns.TypeSSHFP,
	"rrsig":      dns.TypeRRSIG,
	"nsec":       dns.TypeNSEC,
	"dnskey":     dns.TypeDNSKEY,
	"dhcid":      dns.TypeDHCID,
	"nsec3":      dns.TypeNSEC3,
	"nsec3param": dns.TypeNSEC3PARAM,
	"tlsa":       dns.TypeTLSA,
	"smimea":     dns.TypeSMIMEA,
	"hip":        dns.TypeHIP,
	"ninfo":      dns.TypeNINFO,
	"rkey":       dns.TypeRKEY,
	"talink":     dns.TypeTALINK,
	"cds":        dns.TypeCDS,
	"cdnskey":    dns.TypeCDNSKEY,
	"openpgpkey": dns.TypeOPENPGPKEY,
	"csync":      dns.TypeCSYNC,
	"spf":        dns.TypeSPF,
	"uinfo":      dns.TypeUINFO,
	"uid":        dns.TypeUID,
	"gid":        dns.TypeGID,
	"unspec":     dns.TypeUNSPEC,
	"nid":        dns.TypeNID,
	"l32":        dns.TypeL32,
	"l64":        dns.TypeL64,
	"lp":         dns.TypeLP,
	"eui48":      dns.TypeEUI48,
	"eui64":      dns.TypeEUI64,
	"uri":        dns.TypeURI,
	"caa":        dns.TypeCAA,
	"avc":        dns.TypeAVC,

	"tkey":     dns.TypeTKEY,
	"tsig":     dns.TypeTSIG,
	"ixfr":     dns.TypeIXFR,
	"axfr":     dns.TypeAXFR,
	"mailb":    dns.TypeMAILB,
	"maila":    dns.TypeMAILA,
	"any":      dns.TypeANY,
	"ta":       dns.TypeTA,
	"dlv":      dns.TypeDLV,
	"reserved": dns.TypeReserved,
}

StringToType RType string to uint16

Functions

This section is empty.

Types

type AnswerCache

type AnswerCache struct {
	Question dns.Question `json:"question"`
	Answer   []string     `json:"answer"`
	Extra    []string     `json:"extra"`
	Ns       []string     `json:"ns"`

	RecursionAvailable bool `json:"recursion_available"`
	Authoritative      bool `json:"authoritative"`

	Expire time.Time `json:"expire"`
}

AnswerCache answer cache

func (*AnswerCache) ToCache

func (a *AnswerCache) ToCache(msg *dns.Msg)

ToCache cache to Msg

func (*AnswerCache) ToMsg

func (a *AnswerCache) ToMsg(msg *dns.Msg)

ToMsg cache to Msg

type JsonMsgAdditional

type JsonMsgAdditional struct {
}

JsonMsgAdditional json additional

type JsonMsgAnswer

type JsonMsgAnswer struct {
	Name string `json:"name"` // Always matches name in Question
	Type uint16 `json:"type"` // SPF - Standard DNS RR type
	TTL  uint32 `json:"TTL"`  // Record's time-to-live in seconds
	Data string `json:"data"` // Data for SPF - quoted string
}

JsonMsgAnswer json answer

type JsonMsgQuestion

type JsonMsgQuestion struct {
	Name string `json:"name"` // FQDN with trailing dot
	Type uint16 `json:"type"` // SPF - Standard DNS RR type
}

JsonMsgQuestion json question

type JsonMsgResponse

type JsonMsgResponse struct {
	Status           int  // NOERROR - Standard DNS response code (32 bit integer).
	TC               bool // Whether the response is truncated
	RD               bool // Always true for Google Public DNS
	RA               bool // Always true for Google Public DNS
	AD               bool // Whether all response data was validated with DNSSEC
	CD               bool // Whether the client asked to disable DNSSEC
	Question         []JsonMsgQuestion
	Answer           []JsonMsgAnswer
	Additional       []JsonMsgAdditional
	EDNSClientSubnet string `json:"edns_client_subnet"`
	Comment          string `json:"Comment"` // Uncached responses are attributed to the authoritative name server
}

JsonMsgResponse json response

func MsgToJson

func MsgToJson(msg *dns.Msg) (resp JsonMsgResponse)

MsgToJson msg to json message

type RR

type RR struct {
	Type   int
	Name   string
	Value  string
	Filter string
	TTL    int
}

RR (Resource Record) http://dns-learning.twnic.net.tw/bind/intro6.html

Jump to

Keyboard shortcuts

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