Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when the key is not found.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
// Load loads the cache
Load(data map[string]CacheValue) error
// Get returns the value for the given key
Get(domain string) ([]dns.RR, error)
// GetAll returns all the values in the cache
GetAll() map[string]CacheValue
// Set sets the value for the given key
Set(domain string, value []dns.RR) error
// Delete deletes the value for the given key
Delete(key string) error
// Clear clears the cache
Clear() error
// Close closes the cache
Close() error
// Len returns the number of items in the cache
Len() int
// Keys returns the keys in the cache
Keys() []string
// Exists returns true if the key exists
Exists(domain string) bool
// HasExpired returns true if the key has expired
HasExpired(domain string) bool
// GetExpireAt returns the expiration time
GetExpireAt(domain string) time.Time
}
Click to show internal directories.
Click to hide internal directories.