cache

package
v0.0.0-...-54f910c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 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 DNSCache

type DNSCache struct {
	sync.RWMutex
	Cache map[DNSCacheKey]DNSCacheItem
}

func New

func New() *DNSCache

func (*DNSCache) Add

func (c *DNSCache) Add(msg *dns.Msg)

func (*DNSCache) AddRR

func (c *DNSCache) AddRR(rr dns.RR, permanent bool) error

func (*DNSCache) AddRRString

func (c *DNSCache) AddRRString(entry string, permanent bool, ptr bool) error

func (*DNSCache) Debug

func (c *DNSCache) Debug() (result []string)

func (*DNSCache) Delete

func (c *DNSCache) Delete(query *dns.Msg)

func (*DNSCache) DeleteName

func (c *DNSCache) DeleteName(name string, qtype string, ptr bool)

func (*DNSCache) Flush

func (c *DNSCache) Flush() (total, expired int)

func (*DNSCache) Get

func (c *DNSCache) Get(query *dns.Msg) (*dns.Msg, bool)

func (*DNSCache) GetName

func (c *DNSCache) GetName(qname string, qtype string) (*dns.Msg, bool)

Convenience wrapper for c.Get - for testing

type DNSCacheItem

type DNSCacheItem struct {
	Message   *dns.Msg
	Inserted  time.Time
	Expires   time.Time
	Permanent bool
}

func (DNSCacheItem) String

func (i DNSCacheItem) String() string

type DNSCacheKey

type DNSCacheKey struct {
	Name  string
	Qtype uint16
}

func (DNSCacheKey) String

func (k DNSCacheKey) String() string

Jump to

Keyboard shortcuts

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