ns

package
v0.0.0-...-550a133 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package ns provides name server methods for selected name server(s)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	IP      string
	Alpha2  string
	Country string
	City    string
}

A Host represents a name server host

type Request

type Request struct {
	Country      string
	City         string
	Target       string
	Type         uint16
	Host         string
	Hosts        []Host
	TraceEnabled bool
}

A Request represents a name server request

func NewRequest

func NewRequest() *Request

NewRequest creates a new dns request object

func (*Request) ChkCountry

func (d *Request) ChkCountry(country string) bool

ChkCountry validates and set requested country

func (*Request) ChkNode

func (d *Request) ChkNode(city string) bool

ChkNode set requested country

func (*Request) CountryList

func (d *Request) CountryList() []string

CountryList init the connect contry items

func (*Request) Dig

func (d *Request) Dig()

Dig looks up name server w/ trace feature

func (*Request) Init

func (d *Request) Init()

Init configure dns command and fetch name servers

func (*Request) Local

func (d *Request) Local()

Local set host to nothing means local

func (*Request) NodeList

func (d *Request) NodeList() []string

NodeList gets the node city items

func (*Request) RunDig

func (d *Request) RunDig()

RunDig looks up name server

func (*Request) RunDigTrace

func (d *Request) RunDigTrace()

RunDigTrace handles dig trace

func (*Request) SetOptions

func (d *Request) SetOptions(args, prompt string) bool

SetOptions passes arguments to appropriate variable

Jump to

Keyboard shortcuts

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