cache

package
v0.0.0-...-e7b131c Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParseCacheType = errors.New("cannot parse cache type")

Functions

This section is empty.

Types

type Cache

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

func New

func New(settings Settings) Cache

New creates a new cache object except when the cache type is set to Disabled. In this case it returns a nil Cache.

type Settings

type Settings struct {
	Type Type
	LRU  lru.Settings
}

func (*Settings) Lines

func (s *Settings) Lines(indent, subSection string) (lines []string)

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (*Settings) String

func (s *Settings) String() string

type Type

type Type string
const (
	LRU      Type = "lru"
	Disabled Type = "disabled"
)

func ListTypes

func ListTypes() (types []Type)

func ParseCacheType

func ParseCacheType(s string) (cacheType Type, err error)

Directories

Path Synopsis
Package mock_cache is a generated GoMock package.
Package mock_cache is a generated GoMock package.

Jump to

Keyboard shortcuts

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