Documentation
¶
Overview ¶
Package cache provides caching functionality for DNS records and zones.
Package cache provides caching functionality for DNS records and zones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RecordsCache ¶
type RecordsCache struct {
// contains filtered or unexported fields
}
RecordsCache provides caching for DNS records using Ristretto cache. It stores a mapping of cache keys to lists of DNS records.
func NewRecordsCache ¶
func NewRecordsCache(capacity int) (*RecordsCache, error)
NewRecordsCache creates a new RecordsCache instance with the specified capacity. The capacity determines the maximum number of items that can be stored in the cache. Returns the cache instance and any error encountered during initialization.
func (*RecordsCache) Delete ¶
func (c *RecordsCache) Delete(key string)
type ZonesCache ¶
type ZonesCache struct {
// contains filtered or unexported fields
}
ZonesCache provides caching for DNS zones using Ristretto cache. It stores a mapping of cache keys to lists of zone names.
func NewZonesCache ¶
func NewZonesCache() (*ZonesCache, error)
NewZonesCache creates a new ZonesCache instance with default configuration. Returns the cache instance and any error encountered during initialization.
func (*ZonesCache) Delete ¶
func (c *ZonesCache) Delete(key string)
func (*ZonesCache) Get ¶
func (c *ZonesCache) Get(key string) ([]string, bool)
Get retrieves a list of zones from the cache for the given key. Returns the zones and a boolean indicating if the key was found.
func (*ZonesCache) Set ¶
func (c *ZonesCache) Set(key string, value []string)
Set stores a list of zones in the cache with the given key. The cost is calculated based on the length of the zones slice.