authcache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthServer

type AuthServer struct {
	Host  string
	Rtt   int64
	Count int64
}

AuthServer type

func NewAuthServer

func NewAuthServer(host string) *AuthServer

NewAuthServer return a server

func (*AuthServer) String

func (a *AuthServer) String() string

type AuthServers

type AuthServers struct {
	sync.RWMutex

	List []*AuthServer
	// contains filtered or unexported fields
}

AuthServers type

func (*AuthServers) TrySort

func (s *AuthServers) TrySort() bool

TrySort if necessary sort servers by rtt

type NS

type NS struct {
	Servers *AuthServers
	DSRR    []dns.RR
	// 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)

Get returns the entry for a key or an error

func (*NSCache) Set

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

Set sets a keys value to a NS

Jump to

Keyboard shortcuts

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