model

package
v0.0.0-...-1cbaff0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string = "0.0.0"
	Commit  string = "unknown"
	Date    string = time.Now().Format("2006-01-02")
)
View Source
var DNSClient dns.Client

Functions

func GetVersion

func GetVersion() string

func PrintVersion

func PrintVersion()

func WithQNAME

func WithQNAME(qname string) func(*Task)

func WithQTYPE

func WithQTYPE(qtype string) func(*Task)

func WithResolver

func WithResolver(resolver string) func(*Task)

func WithTimeout

func WithTimeout(timeout int64) func(*Task)

Types

type DNS

type DNS struct {
	Request  *ReadableMsg `json:"request"`
	Response *ReadableMsg `json:"response"`
}

type ReadableMsg

type ReadableMsg struct {
	Header    ReadableMsgHdr     `json:"header"`
	Questions []ReadableQuestion `json:"questions,omitempty"`
	Answers   []ReadableRR       `json:"answers,omitempty"`
	Ns        []ReadableRR       `json:"authority,omitempty"`
	Extra     []ReadableRR       `json:"additional,omitempty"`
}

func NewReadableMsg

func NewReadableMsg(msg *dns.Msg) *ReadableMsg

type ReadableMsgHdr

type ReadableMsgHdr struct {
	dns.MsgHdr
}

func (ReadableMsgHdr) MarshalJSON

func (h ReadableMsgHdr) MarshalJSON() ([]byte, error)

type ReadableQuestion

type ReadableQuestion struct {
	dns.Question
}

func (ReadableQuestion) MarshalJSON

func (q ReadableQuestion) MarshalJSON() ([]byte, error)

type ReadableRR

type ReadableRR struct {
	dns.RR
}

func (ReadableRR) MarshalJSON

func (rr ReadableRR) MarshalJSON() ([]byte, error)

type Task

type Task struct {
	QNAME    string `json:"qname"`
	QTYPE    string `json:"qtype"`
	Resolver string `json:"resolver"`
	Timeout  int64  `json:"timeout"`
	DNS      DNS    `json:"dns"`
}

func NewTask

func NewTask(options ...func(*Task)) *Task

func (*Task) Do

func (t *Task) Do() error

Jump to

Keyboard shortcuts

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