dns_check

package module
v0.0.0-...-251b3b0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: AGPL-3.0 Imports: 24 Imported by: 1

README

dns_check

Documentation

Index

Constants

View Source
const (
	Version = "1.0.9"

	// DefaultLogFormat string = "2006年01月02日 15:04:05.000"
	DefaultLogFormat string = "2006年01月02日 15時04分05.000秒"
)

Variables

View Source
var MetricAllPrefixes = map[string]MetricPrefix{
	"quetta": {Symbol: "Q", Base10: math.Pow(10, 30), Pow: 30, FullName: "quetta", Adoption: 2022},
	"ronna":  {Symbol: "R", Base10: math.Pow(10, 27), Pow: 27, FullName: "ronna", Adoption: 2022},
	"yotta":  {Symbol: "Y", Base10: math.Pow(10, 24), Pow: 24, FullName: "yotta", Adoption: 1991},
	"zetta":  {Symbol: "Z", Base10: math.Pow(10, 21), Pow: 21, FullName: "zetta", Adoption: 1991},
	"exa":    {Symbol: "E", Base10: math.Pow(10, 18), Pow: 18, FullName: "exa", Adoption: 1975},
	"peta":   {Symbol: "P", Base10: math.Pow(10, 15), Pow: 15, FullName: "peta", Adoption: 1975},
	"tera":   {Symbol: "T", Base10: math.Pow(10, 12), Pow: 12, FullName: "tera", Adoption: 1960},
	"giga":   {Symbol: "G", Base10: math.Pow(10, 9), Pow: 9, FullName: "giga", Adoption: 1960},
	"mega":   {Symbol: "M", Base10: math.Pow(10, 6), Pow: 6, FullName: "mega", Adoption: 1873},
	"kilo":   {Symbol: "k", Base10: math.Pow(10, 3), Pow: 3, FullName: "kilo", Adoption: 1795},
	"hecto":  {Symbol: "h", Base10: math.Pow(10, 2), Pow: 2, FullName: "hecto", Adoption: 1795},
	"deca":   {Symbol: "da", Base10: math.Pow(10, 1), Pow: 1, FullName: "deca", Adoption: 1795},
	"none":   {Symbol: "", Base10: math.Pow(10, 0), Pow: 0, FullName: "none", Adoption: 1795},
	"deci":   {Symbol: "d", Base10: math.Pow(10, -1), Pow: -1, FullName: "deci", Adoption: 1795},
	"centi":  {Symbol: "c", Base10: math.Pow(10, -2), Pow: -2, FullName: "centi", Adoption: 1795},
	"milli":  {Symbol: "m", Base10: math.Pow(10, -3), Pow: -3, FullName: "milli", Adoption: 1795},
	"micro":  {Symbol: "µ", Base10: math.Pow(10, -6), Pow: -6, FullName: "micro", Adoption: 1873},
	"nano":   {Symbol: "n", Base10: math.Pow(10, -9), Pow: -9, FullName: "nano", Adoption: 1960},
	"pico":   {Symbol: "p", Base10: math.Pow(10, -12), Pow: -12, FullName: "pico", Adoption: 1960},
	"femto":  {Symbol: "f", Base10: math.Pow(10, -15), Pow: -15, FullName: "femto", Adoption: 1964},
	"atto":   {Symbol: "a", Base10: math.Pow(10, -18), Pow: -18, FullName: "atto", Adoption: 1964},
	"zepto":  {Symbol: "z", Base10: math.Pow(10, -21), Pow: -21, FullName: "zepto", Adoption: 1991},
	"yocto":  {Symbol: "y", Base10: math.Pow(10, -24), Pow: -24, FullName: "yocto", Adoption: 1991},
	"ronto":  {Symbol: "r", Base10: math.Pow(10, -27), Pow: -27, FullName: "ronto", Adoption: 2022},
	"quecto": {Symbol: "q", Base10: math.Pow(10, -30), Pow: -30, FullName: "quecto", Adoption: 2022},
}
View Source
var MetricCommonPrefixes = map[string]MetricPrefix{
	"quetta": {Symbol: "Q", Base10: math.Pow(10, 30), Pow: 30, FullName: "quetta", Adoption: 2022},
	"ronna":  {Symbol: "R", Base10: math.Pow(10, 27), Pow: 27, FullName: "ronna", Adoption: 2022},
	"yotta":  {Symbol: "Y", Base10: math.Pow(10, 24), Pow: 24, FullName: "yotta", Adoption: 1991},
	"zetta":  {Symbol: "Z", Base10: math.Pow(10, 21), Pow: 21, FullName: "zetta", Adoption: 1991},
	"exa":    {Symbol: "E", Base10: math.Pow(10, 18), Pow: 18, FullName: "exa", Adoption: 1975},
	"peta":   {Symbol: "P", Base10: math.Pow(10, 15), Pow: 15, FullName: "peta", Adoption: 1975},
	"tera":   {Symbol: "T", Base10: math.Pow(10, 12), Pow: 12, FullName: "tera", Adoption: 1960},
	"giga":   {Symbol: "G", Base10: math.Pow(10, 9), Pow: 9, FullName: "giga", Adoption: 1960},
	"mega":   {Symbol: "M", Base10: math.Pow(10, 6), Pow: 6, FullName: "mega", Adoption: 1873},
	"kilo":   {Symbol: "k", Base10: math.Pow(10, 3), Pow: 3, FullName: "kilo", Adoption: 1795},
	"none":   {Symbol: "", Base10: math.Pow(10, 0), Pow: 0, FullName: "none", Adoption: 1795},
	"milli":  {Symbol: "m", Base10: math.Pow(10, -3), Pow: -3, FullName: "milli", Adoption: 1795},
	"micro":  {Symbol: "µ", Base10: math.Pow(10, -6), Pow: -6, FullName: "micro", Adoption: 1873},
	"nano":   {Symbol: "n", Base10: math.Pow(10, -9), Pow: -9, FullName: "nano", Adoption: 1960},
	"pico":   {Symbol: "p", Base10: math.Pow(10, -12), Pow: -12, FullName: "pico", Adoption: 1960},
	"femto":  {Symbol: "f", Base10: math.Pow(10, -15), Pow: -15, FullName: "femto", Adoption: 1964},
	"atto":   {Symbol: "a", Base10: math.Pow(10, -18), Pow: -18, FullName: "atto", Adoption: 1964},
	"zepto":  {Symbol: "z", Base10: math.Pow(10, -21), Pow: -21, FullName: "zepto", Adoption: 1991},
	"yocto":  {Symbol: "y", Base10: math.Pow(10, -24), Pow: -24, FullName: "yocto", Adoption: 1991},
	"ronto":  {Symbol: "r", Base10: math.Pow(10, -27), Pow: -27, FullName: "ronto", Adoption: 2022},
	"quecto": {Symbol: "q", Base10: math.Pow(10, -30), Pow: -30, FullName: "quecto", Adoption: 2022},
}

Functions

func DefaultDnsOpts

func DefaultDnsOpts() dnsOpts

func Digit

func Digit(z *big.Int, digit int, pos int)

func Run

func Run(conf Config) (int, error)

func RunWithContext

func RunWithContext(ctx context.Context, conf Config) (int, error)

Types

type ActiveForwarder

type ActiveForwarder struct {
	Forwarder Forwarder
	Resolved  bool
	Priority  int64 // lower is first
}

type Config

type Config struct {
	Forwarders        []ForwarderGroup
	LogWriter         io.Writer
	DnsResolveTimeout time.Duration
	DnsResolveRetries int

	Debug          bool
	NoNonErr       bool
	NoPrintDnsErr  bool
	AllPrintDnsErr bool
	NoTime         bool
	CpuProfile     bool
	TraceProf      bool
}

type Forwarder

type Forwarder struct {
	Server       netip.AddrPort `yaml:"server"`
	Test_domains []string       `yaml:"test_domains"`
	Ftype        ForwarderType  `yaml:"ftype"` // 'dns', 'tls', 'http', 'dnscrypt'

}

type ForwarderGroup

type ForwarderGroup struct {
	Name       string      `yaml:"name"`
	Forwarders []Forwarder `yaml:"forwarders"`
	Opts       dnsOpts     `yaml:"opts"`
}

type ForwarderType

type ForwarderType string
const (
	ForwarderTypeDNS      ForwarderType = "dns"
	ForwarderTypeTLS      ForwarderType = "tls"
	ForwarderTypeHTTP     ForwarderType = "http"
	ForwarderTypeDNSCrypt ForwarderType = "dnscrypt"
)

type MetricPrefix

type MetricPrefix struct {
	Symbol   string
	Base10   float64
	Pow      int64
	FullName string
	Adoption int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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