service

package
v0.0.0-...-aaec902 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOST   = 600
	REBIND = 0
)

Variables

View Source
var (
	ModTime time.Time
	NSMap   sync.Map
)

Functions

func Init

func Init(filepath string)

func IsUsefulIp

func IsUsefulIp(ip string) bool

func NewSuffixTree

func NewSuffixTree(key string, value string) *suffixTreeNode

func NewSuffixTreeRoot

func NewSuffixTreeRoot() *suffixTreeNode

func UnFqdn

func UnFqdn(s string) string

Types

type Counter

type Counter struct {
	sync.RWMutex
	// contains filtered or unexported fields
}
var R Counter

func (*Counter) Create

func (c *Counter) Create(domain string)

func (*Counter) Get

func (c *Counter) Get(domain string) int

func (*Counter) Has

func (c *Counter) Has(domain string) bool

type FileChecker

type FileChecker struct {
	Filename      string
	FileTimestamp int64
}

type Host

type Host struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewHost

func NewHost(filename string) *Host

func (*Host) Delete

func (h *Host) Delete(qname string)

func (*Host) Get

func (h *Host) Get(qname string) (string, bool)

func (*Host) InitHosts

func (h *Host) InitHosts(filename string)

func (*Host) Set

func (h *Host) Set(domain, ip string)

func (*Host) Update

func (h *Host) Update(qname, ip string)

type Resolver

type Resolver struct {
	NameServers []string
	Forward     map[string]string
}

func NewResolver

func NewResolver(nameserverFileName, resolverFilename string) *Resolver

func (*Resolver) GetNameServers

func (r *Resolver) GetNameServers(qname string) []string

func (*Resolver) Lookup

func (r *Resolver) Lookup(net string, req *dns.Msg) (message *dns.Msg, err error)

func (*Resolver) Timeout

func (r *Resolver) Timeout() time.Duration

type Settings

type Settings struct {
	FilePath   string
	Nameserver string
	Hosts      string
	Resolv     string
}
var Config Settings

Jump to

Keyboard shortcuts

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