Documentation
¶
Index ¶
- type MemoryCache
- func (c *MemoryCache) Clear() error
- func (c *MemoryCache) Close() error
- func (c *MemoryCache) Delete(domain string) error
- func (c *MemoryCache) Exists(domain string) bool
- func (c *MemoryCache) Get(domain string) ([]dns.RR, error)
- func (c *MemoryCache) GetAll() map[string]base.CacheValue
- func (c *MemoryCache) GetExpireAt(domain string) time.Time
- func (c *MemoryCache) HasExpired(domain string) bool
- func (c *MemoryCache) Keys() []string
- func (c *MemoryCache) Len() int
- func (c *MemoryCache) Load(data map[string]base.CacheValue) error
- func (c *MemoryCache) Set(domain string, value []dns.RR) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache is an in-memory cache.
func (*MemoryCache) Delete ¶
func (c *MemoryCache) Delete(domain string) error
Delete deletes the value for the given key.
func (*MemoryCache) Exists ¶
func (c *MemoryCache) Exists(domain string) bool
Exists returns true if the key exists.
func (*MemoryCache) Get ¶
func (c *MemoryCache) Get(domain string) ([]dns.RR, error)
Get returns the value for the given key.
func (*MemoryCache) GetAll ¶
func (c *MemoryCache) GetAll() map[string]base.CacheValue
GetAll returns all the values in the cache.
func (*MemoryCache) GetExpireAt ¶
func (c *MemoryCache) GetExpireAt(domain string) time.Time
GetExpireAt returns the expiration time.
func (*MemoryCache) HasExpired ¶
func (c *MemoryCache) HasExpired(domain string) bool
HasExpired returns true if the key has expired.
func (*MemoryCache) Keys ¶
func (c *MemoryCache) Keys() []string
Keys returns the keys in the cache.
func (*MemoryCache) Len ¶
func (c *MemoryCache) Len() int
Len returns the number of items in the cache.
func (*MemoryCache) Load ¶
func (c *MemoryCache) Load(data map[string]base.CacheValue) error
Load loads the cache.
Click to show internal directories.
Click to hide internal directories.