Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v0.12.0
type Cache struct {
// contains filtered or unexported fields
}
Cache provides a means of caching domains in memory to reduce load on an underlying storage mechanism, e.g. a database.
The in-memory domain list is kept up-to-date by means of a passed loader function during every call to .Matches(). In the case of a nil internal domain list, the loader function is called to hydrate the cache with the latest list of domains.
The .Clear() function can be used to invalidate the cache, e.g. when an entry is added / deleted from the database.
func (*Cache) Clear ¶ added in v0.12.0
func (c *Cache) Clear()
Clear will drop the currently loaded domain list, triggering a reload on next call to .Matches().
Click to show internal directories.
Click to hide internal directories.