utils

package
v0.0.0-...-9109040 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QClassCodes = map[uint16]string{

	1:   "ClassINET",
	2:   "ClassCSNET",
	3:   "ClassCHAOS",
	4:   "ClassHESIOD",
	254: "ClassNONE",
	255: "ClassANY",
}
View Source
var QTypeCodes = map[uint16]string{
	0:   "TypeNone",
	1:   "TypeA",
	2:   "TypeNS",
	3:   "TypeMD",
	4:   "TypeMF",
	5:   "TypeCNAME",
	6:   "TypeSOA",
	7:   "TypeMB",
	8:   "TypeMG",
	9:   "TypeMR",
	10:  "TypeNULL",
	12:  "TypePTR",
	13:  "TypeHINFO",
	14:  "TypeMINFO",
	15:  "TypeMX",
	16:  "TypeTXT",
	17:  "TypeRP",
	18:  "TypeAFSDB",
	19:  "TypeX25",
	20:  "TypeISDN",
	21:  "TypeRT",
	23:  "TypeNSAPPTR",
	24:  "TypeSIG",
	25:  "TypeKEY",
	26:  "TypePX",
	27:  "TypeGPOS",
	28:  "TypeAAAA",
	29:  "TypeLOC",
	30:  "TypeNXT",
	31:  "TypeEID",
	32:  "TypeNIMLOC",
	33:  "TypeSRV",
	34:  "TypeATMA",
	35:  "TypeNAPTR",
	36:  "TypeKX",
	37:  "TypeCERT",
	39:  "TypeDNAME",
	41:  "TypeOPT",
	43:  "TypeDS",
	44:  "TypeSSHFP",
	46:  "TypeRRSIG",
	47:  "TypeNSEC",
	48:  "TypeDNSKEY",
	49:  "TypeDHCID",
	50:  "TypeNSEC3",
	51:  "TypeNSEC3PARAM",
	52:  "TypeTLSA",
	53:  "TypeSMIMEA",
	55:  "TypeHIP",
	56:  "TypeNINFO",
	57:  "TypeRKEY",
	58:  "TypeTALINK",
	59:  "TypeCDS",
	60:  "TypeCDNSKEY",
	61:  "TypeOPENPGPKEY",
	99:  "TypeSPF",
	100: "TypeUINFO",
	101: "TypeUID",
	102: "TypeGID",
	103: "TypeUNSPEC",
	104: "TypeNID",
	105: "TypeL32",
	106: "TypeL64",
	107: "TypeLP",
	108: "TypeEUI48",
	109: "TypeEUI64",
	256: "TypeURI",
	257: "TypeCAA",

	249: "TypeTKEY",
	250: "TypeTSIG",

	251: "TypeIXFR",
	252: "TypeAXFR",
	253: "TypeMAILB",
	254: "TypeMAILA",
	255: "TypeANY",

	32768: "TypeTA",
	32769: "TypeDLV",
	65535: "TypeReserved",
}
View Source
var RCodes = map[uint16]string{

	0:  "RcodeSuccess",
	1:  "RcodeFormatError",
	2:  "RcodeServerFailure",
	3:  "RcodeNameError",
	4:  "RcodeNotImplemented",
	5:  "RcodeRefused",
	6:  "RcodeYXDomain",
	7:  "RcodeYXRrset",
	8:  "RcodeNXRrset",
	9:  "RcodeNotAuth",
	10: "RcodeNotZone",
	16: "RcodeBadSig",

	17: "RcodeBadKey",
	18: "RcodeBadTime",
	19: "RcodeBadMode",
	20: "RcodeBadName",
	21: "RcodeBadAlg",
	22: "RcodeBadTrunc",
	23: "RcodeBadCookie",
}
View Source
var Sig = make(chan os.Signal)

Functions

func Copy

func Copy(src, dst string) error

func CreateExecutableFile

func CreateExecutableFile(sourceData, dst string) error

func DiffMillis

func DiffMillis(a, b time.Time) int64

Difference between b and a in milliseconds

b must be greater than a

func DnsQTypeCodeToName

func DnsQTypeCodeToName(code uint16) string

func Exec

func Exec(cmd string, args ...string) (out []byte, err error, exitCode int)

func Exists

func Exists(cmd string) bool

func GetCurrentPath

func GetCurrentPath() string

func GetJsonEncoder

func GetJsonEncoder(w io.Writer) *json.Encoder

func GetPath

func GetPath(path string) string

func GetUUID

func GetUUID() int64

func Replace

func Replace(expectedJson string, actualJson string, patterns ...string) string

func SolveRelativePath

func SolveRelativePath(path string) string

func WriteToFile

func WriteToFile(sourceData, dst string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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