authcache

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort added in v1.0.0

func Sort(serversList []*AuthServer, called uint64)

Sort sort servers by rtt.

Types

type AuthServer

type AuthServer struct {
	// place atomic members at the start to fix alignment for ARM32
	Rtt     int64
	Count   int64
	Addr    string
	Version Version
}

AuthServer type.

func NewAuthServer

func NewAuthServer(addr string, version Version) *AuthServer

NewAuthServer return a new server.

func (*AuthServer) String

func (a *AuthServer) String() string

type AuthServers

type AuthServers struct {
	sync.RWMutex
	// place atomic members at the start to fix alignment for ARM32
	Called     uint64
	ErrorCount uint32

	Zone string

	List []*AuthServer
	Nss  []string

	CheckingDisable bool
	Checked         bool
}

AuthServers type.

type NS

type NS struct {
	Servers *AuthServers
	DSRR    []dns.RR
	TTL     time.Duration
	// contains filtered or unexported fields
}

NS represents a cache entry.

type NSCache

type NSCache struct {
	// contains filtered or unexported fields
}

NSCache type.

func NewNSCache

func NewNSCache() *NSCache

NewNSCache return new cache.

func (*NSCache) Get

func (n *NSCache) Get(key uint64) (*NS, error)

(*NSCache).Get get returns the entry for a key or an error.

func (*NSCache) Remove added in v0.3.4

func (n *NSCache) Remove(key uint64)

(*NSCache).Remove remove remove a cache.

func (*NSCache) Set

func (n *NSCache) Set(key uint64, dsRR []dns.RR, servers *AuthServers, ttl time.Duration)

(*NSCache).Set set sets a keys value to a NS.

type Version added in v1.0.0

type Version byte

Version type.

const (
	// IPv4 mode.
	IPv4 Version = 0x1

	// IPv6 mode.
	IPv6 Version = 0x2
)

func (Version) String added in v1.0.0

func (v Version) String() string

Jump to

Keyboard shortcuts

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