cache

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Get retrieves v from Backend. The returned v is a deepcopy of the original msg
	// if the key is stored in the cache. Otherwise, v is nil.
	// If allowExpired, v might be expired as long as the key is in the cache.
	// Note: The caller should change the TTLs and id of v.
	Get(ctx context.Context, key string, allowExpired bool) (v *dns.Msg, storedTime, expirationTime time.Time, err error)

	// Store stores a deepcopy of v into Backend. v cannot be nil.
	// If expirationTime is already passed, Store is a noop.
	Store(ctx context.Context, key string, v *dns.Msg, storedTime, expirationTime time.Time) (err error)

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

Backend 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