cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultMinTTL = time.Minute    // DefaultMinTTL 默认dns缓存最小有效期
	DefaultMaxTTL = 24 * time.Hour // DefaultMaxTTL 默认dns缓存最大有效期
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IDNSCache added in v1.0.0

type IDNSCache interface {
	// Get find cached response
	Get(req *dns.Msg) *dns.Msg
	// Set save response to cache
	Set(req *dns.Msg, resp *dns.Msg)
	// Start life cycle begin
	Start(cleanTick ...time.Duration)
	// Stop life cycle end
	Stop()
}

IDNSCache cache dns response for dns request

func NewDNSCache

func NewDNSCache(conf config.Conf) (IDNSCache, error)

Jump to

Keyboard shortcuts

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