cache

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeferCacheStore added in v1.5.2

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

DeferCacheStore implements handler.Executable.

func NewDeferStore added in v1.5.2

func NewDeferStore(key string, backend DnsCache) *DeferCacheStore

func (*DeferCacheStore) Exec added in v1.5.2

func (d *DeferCacheStore) Exec(ctx context.Context, qCtx *handler.Context) (err error)

Exec caches the response. It never returns an err, because a cache fault should not terminate the query process.

type DnsCache

type DnsCache interface {
	// Get retrieves v from DnsCache. The returned v is a deepcopy of the original msg
	// that stored in the cache. The TTLs of v has already been modified properly.
	// The only thing that call should modify is msg's id.
	Get(ctx context.Context, key string) (v *dns.Msg, err error)
	// Store stores the v into DnsCache. It stores the deepcopy of v.
	Store(ctx context.Context, key string, v *dns.Msg, ttl time.Duration) (err error)

	// Closer closes the cache backend.
	io.Closer
}

DnsCache represents a DNS cache backend.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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