dns

package
v0.0.0-...-0965ce9 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrategyCheck        = "check"
	StrategyCheckAndStop = "check_and_stop"
	StrategySkipOrCheck  = "skip_or_check"
)

Strategy

Variables

View Source
var (
	RecordsMap map[string][]Record
	Upstreams  []string
	IsVerbose  bool
)

Main props

Functions

func RecordHandleAnswer

func RecordHandleAnswer(m *dns.Msg, q dns.Question, record Record, answersCount int) (bool, bool)

RecordHandleAnswer ..

func RecordMapLoadJSON

func RecordMapLoadJSON(jsonPath string) (map[string][]Record, error)

RecordMapLoadJSON ..

func ServerLoadRecords

func ServerLoadRecords(jsonPath string)

ServerLoadRecords ..

func ServerStart

func ServerStart(addr string)

ServerStart ..

func UtilPingHost

func UtilPingHost(host string, maxSeconds int) bool

UtilPingHost ..

func UtilRenderTpl

func UtilRenderTpl(tpl string, data map[string]interface{}) string

UtilRenderTpl ..

Types

type Record

type Record struct {
	Strategy string `json:"strategy,omitempty"`
	IP       string `json:"ip,omitempty"`
	Answer   string `json:"answer"`
}

Record ..

Jump to

Keyboard shortcuts

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