cache

package
v2.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheMustBeSet = errors.New("cache must be set")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(request *dns.Msg) *dns.Msg
	Add(request, response *dns.Msg)
}

type Middleware

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

func New

func New(settings Settings) (middleware *Middleware, err error)

func (*Middleware) Stop

func (m *Middleware) Stop() (err error)

func (*Middleware) String

func (m *Middleware) String() string

func (*Middleware) Wrap

func (m *Middleware) Wrap(next dns.Handler) dns.Handler

type Settings

type Settings struct {
	Cache Cache
}

func (*Settings) Validate

func (s *Settings) Validate() (err error)

Directories

Path Synopsis
metrics
noop
Package noop defines a No-op metric implementation for the cache.
Package noop defines a No-op metric implementation for the cache.
prometheus
Package prometheus defines a Prometheus metric implementation for the cache.
Package prometheus defines a Prometheus metric implementation for the cache.

Jump to

Keyboard shortcuts

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