Documentation ¶
Index ¶
- type Query
- type QueryResults
- type Result
- type Server
- type ServerList
- func (sl *ServerList) DumpToFile(filename string) (err error)
- func (sl *ServerList) ExecuteQuery(q *Query, threads int) (qr QueryResults)
- func (sl *ServerList) FilterCountry(country string) (fl ServerList, err error)
- func (sl *ServerList) NRandom(n int) (rl ServerList, err error)
- func (sl *ServerList) TestAll(threads int) (working ServerList)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query struct { Results QueryResults Domain string Type uint16 }
Query represents a lookup of Type for a given Domain and stores the Results for later processing
func (*Query) GetType ¶
GetType looks up the current Query's uint16 Type and returns the string representation of it from the miekg/dns library.
func (*Query) SetType ¶
SetType converts a string representation of a query type to the internal uint16. This is then set on the current Query. An error is returned if the type cannot be found in the miekg/dns library.
func (*Query) ToTextSummary ¶
ToTextSummary prints a human readable output of the current query's results for use in the CLI.
type QueryResults ¶
QueryResults maps servers by name to the results they provide so a more detailed response can be given.
func (*QueryResults) ToJSON ¶
func (qr *QueryResults) ToJSON() (string, error)
ToJSON prints a verbose JSON representation of the current QueryResults object
type Server ¶
Server contains information about a specific nameserver that can be queried
func (*Server) Lookup ¶
Lookup makes a request for a given domain name and record type to the current server IP on the standard port 53.
Results are returned as either a slice of strings representing the IPs returned, or an error object with a simplified error response.
type ServerList ¶
type ServerList []Server
ServerList is an alias for a slice of Server objects used for performing bulk actions on multiple threads
func ServersFromCSVURL ¶
func ServersFromCSVURL(url string) (sl ServerList, err error)
ServersFromCSVURL loads a ServerList from a CSV provided at a given URL. Designed for use with public-info.dns
func ServersFromFile ¶
func ServersFromFile(filename string) (sl ServerList, err error)
ServersFromFile loads a ServerList from a YAML file. Will raise an error if the file cannot be opened or processed
func (*ServerList) DumpToFile ¶
func (sl *ServerList) DumpToFile(filename string) (err error)
DumpToFile a the current server list to a YAML file. Includes a commented header to identify the fact it is generated.
func (*ServerList) ExecuteQuery ¶
func (sl *ServerList) ExecuteQuery(q *Query, threads int) (qr QueryResults)
ExecuteQuery runs a Query object in a specified number of threads. The returned QueryResult is not associated with the provided Query, however may be set by the caller.
func (*ServerList) FilterCountry ¶
func (sl *ServerList) FilterCountry(country string) (fl ServerList, err error)
FilterCountry filters the current server list by country and returns a new server list with the matching servers in it. Returns an error if no servers were found.
func (*ServerList) NRandom ¶
func (sl *ServerList) NRandom(n int) (rl ServerList, err error)
NRandom returns n random servers from the current server list in a new list. Will return an error if there are less than n servers in the current list.
func (*ServerList) TestAll ¶
func (sl *ServerList) TestAll(threads int) (working ServerList)
TestAll tests all the servers in the current list and returns a new list with only the workings ones.