Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // WallClock is the wall clock WallClock = clockwork.NewRealClock() // ErrCacheNotFound error ErrCacheNotFound = errors.New("cache not found") // ErrCacheExpired error ErrCacheExpired = errors.New("cache expired") )
Functions ¶
Types ¶
type AuthServers ¶
type AuthServers struct { sync.RWMutex List []*AuthServer // contains filtered or unexported fields }
AuthServers type
func (*AuthServers) TrySort ¶
func (s *AuthServers) TrySort()
TrySort if necessary sort servers by rtt
type ErrorCache ¶
type ErrorCache struct {
// contains filtered or unexported fields
}
ErrorCache type
func NewErrorCache ¶
func NewErrorCache(size int, ttl uint32) *ErrorCache
NewErrorCache return new cache
func (*ErrorCache) Get ¶
func (c *ErrorCache) Get(key uint64) error
Get returns the entry for a key or an error
func (*ErrorCache) Remove ¶
func (c *ErrorCache) Remove(key uint64)
Remove removes an entry from the cache
func (*ErrorCache) Set ¶
func (c *ErrorCache) Set(key uint64) error
Set sets a keys value to a error cache
type NS ¶
type NS struct { Servers *AuthServers Network string DSRR []dns.RR TTL uint32 UpdateTime time.Time // contains filtered or unexported fields }
NS represents a cache entry
type NSCache ¶
type NSCache struct {
// contains filtered or unexported fields
}
NSCache type
type Query ¶
type Query struct { Item *item RateLimit *rl.RateLimiter UpdateTime time.Time // contains filtered or unexported fields }
Query represents a cache entry
type QueryCache ¶
type QueryCache struct {
// contains filtered or unexported fields
}
QueryCache type
func NewQueryCache ¶
func NewQueryCache(size int, ratelimit int) *QueryCache
NewQueryCache return new cache
func (*QueryCache) Get ¶
func (c *QueryCache) Get(key uint64, req *dns.Msg) (*dns.Msg, *rl.RateLimiter, error)
Get returns the entry for a key or an error
func (*QueryCache) Remove ¶
func (c *QueryCache) Remove(key uint64)
Remove removes an entry from the cache
Click to show internal directories.
Click to hide internal directories.