sdns: Index | Files

package authcache

import ""


Package Files

authserver.go ns_cache.go

func Sort Uses

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

Sort sort servers by rtt

type AuthServer Uses

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 Uses

func NewAuthServer(addr string, version Version) *AuthServer

NewAuthServer return a new server

func (*AuthServer) String Uses

func (a *AuthServer) String() string

type AuthServers Uses

type AuthServers struct {
    // 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 Uses

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

NS represents a cache entry

type NSCache Uses

type NSCache struct {
    // contains filtered or unexported fields

NSCache type

func NewNSCache Uses

func NewNSCache() *NSCache

NewNSCache return new cache

func (*NSCache) Get Uses

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

Get returns the entry for a key or an error

func (*NSCache) Remove Uses

func (n *NSCache) Remove(key uint64)

Remove remove a cache

func (*NSCache) Set Uses

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

Set sets a keys value to a NS

type Version Uses

type Version byte

Version type

const (
    // IPv4 mode
    IPv4 Version = 0x1

    // IPv6 mode
    IPv6 Version = 0x2

func (Version) String Uses

func (v Version) String() string

Package authcache imports 6 packages (graph) and is imported by 1 packages. Updated 2020-08-10. Refresh now. Tools for package owners.