Documentation
¶
Index ¶
- func Round(val float64) uint32
- type Cache
- func (c *Cache) Add(s utils.Service) bool
- func (c *Cache) Containkey(name string) bool
- func (c *Cache) Contains(name string, rt string) bool
- func (c *Cache) Get(s utils.Service) ([]utils.Entry, error)
- func (c *Cache) Keys() []interface{}
- func (c *Cache) Len() int
- func (c *Cache) List() []utils.Service
- func (c *Cache) Purge()
- func (c *Cache) Remove(s utils.Service) error
- func (c *Cache) RemoveOldest()
- func (c *Cache) Set(originalValue utils.Service, modifyValue utils.Service) error
- type MsgCache
- func (c *MsgCache) Add(s []dns.RR, rtype uint16) bool
- func (c *MsgCache) Get(name string, rtype uint16) ([]dns.RR, *time.Time, error)
- func (c *MsgCache) Keys() (result []interface{})
- func (c *MsgCache) Len() (result int)
- func (c *MsgCache) Purge()
- func (c *MsgCache) Remove(name string, rtype uint16) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a thread-safe fixed size LRU cache.
func NewWithEvict ¶
NewWithEvict constructs a fixed size cache with the given eviction callback.
func (*Cache) Containkey ¶
Contains judge whether domain is in the cache
func (*Cache) Keys ¶
func (c *Cache) Keys() []interface{}
Keys returns a slice of the keys in the cache, from oldest to newest.
func (*Cache) RemoveOldest ¶
func (c *Cache) RemoveOldest()
RemoveOldest removes the oldest item from the cache.
type MsgCache ¶
type MsgCache struct {
// contains filtered or unexported fields
}
Cache is a thread-safe fixed size LRU cache.
func NewMsgCache ¶
New creates an LRU of the given size
func NewMsgCacheWithEvict ¶
NewWithEvict constructs a fixed size cache with the given eviction callback.
func (*MsgCache) Keys ¶
func (c *MsgCache) Keys() (result []interface{})
Keys returns a slice of the keys in the cache, from oldest to newest.
Click to show internal directories.
Click to hide internal directories.