util

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDirectory added in v0.1.7

func ClearDirectory(inputdir string)

clears the contents of a directory but leaves it

func DomainList added in v0.1.3

func DomainList(domain string) []string

based on a domain name ("sub.google.com") returns a slice of domains that should be matched EXACTLY against ["sub.google.com", "google.com", "com"]

func GetFileAsArray

func GetFileAsArray(inputfile string) ([]string, error)

func GetFirstAResponse added in v0.1.9

func GetFirstAResponse(response *dns.Msg) string

func IsEmptyResponse

func IsEmptyResponse(response *dns.Msg) bool

returns true if the response is "empty" nil response empty response (no answers or other sections) answers with no content

func ReverseDomainTree

func ReverseDomainTree(domain string) string

take a domain like "sub.main.top.tld" and transform to "tld.top.main.sub"

func ReverseLookupDomain

func ReverseLookupDomain(ip *net.IP) string

returns the reverse lookup arpa domain for the given IP

func ReverseLookupDomainString

func ReverseLookupDomainString(ipString string) string

func RootDomain

func RootDomain(domain string) string

finds the "root" domain, that is a the domain with just the name and the TLD

func StartsWithAny

func StartsWithAny(value string, any []string) bool

func StringIn

func StringIn(value string, in []string) bool

determines if the given string is in the array of strings

func SubDomain

func SubDomain(domain string) string

finds the subdomain of a requested domain, so "www.google.com" returns "google.com" and "google.com" returns "google.com"

Types

This section is empty.

Jump to

Keyboard shortcuts

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