.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, FaviconCacheConfig cfg) | |
None|tuple[None|bytes, None|str] | __call__ (self, str resolver, str authority) |
bool | set (self, str resolver, str authority, str|None mime, bytes|None data) |
FaviconCacheStats | state (self) |
maintenance (self, force=False) | |
Abstract base class for the implementation of a favicon cache.
searx.favicons.cache.FaviconCache.__init__ | ( | self, | |
FaviconCacheConfig | cfg ) |
An instance of the favicon cache is build up from the configuration.
Reimplemented in searx.favicons.cache.FaviconCacheMEM, searx.favicons.cache.FaviconCacheNull, and searx.favicons.cache.FaviconCacheSQLite.
Definition at line 187 of file cache.py.
None | tuple[None | bytes, None | str] searx.favicons.cache.FaviconCache.__call__ | ( | self, | |
str | resolver, | ||
str | authority ) |
Returns ``None`` or the tuple of ``(data, mime)`` that has been registered in the cache. The ``None`` indicates that there was no entry in the cache.
Reimplemented in searx.favicons.cache.FaviconCacheMEM, searx.favicons.cache.FaviconCacheNull, and searx.favicons.cache.FaviconCacheSQLite.
Definition at line 191 of file cache.py.
searx.favicons.cache.FaviconCache.maintenance | ( | self, | |
force = False ) |
Performs maintenance on the cache
Reimplemented in searx.favicons.cache.FaviconCacheMEM, searx.favicons.cache.FaviconCacheNull, and searx.favicons.cache.FaviconCacheSQLite.
Definition at line 207 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
bool searx.favicons.cache.FaviconCache.set | ( | self, | |
str | resolver, | ||
str | authority, | ||
str | None | mime, | ||
bytes | None | data ) |
Set data and mime-type in the cache. If data is None, the :py:obj:`FALLBACK_ICON` is registered. in the cache.
Reimplemented in searx.favicons.cache.FaviconCacheMEM, searx.favicons.cache.FaviconCacheNull, and searx.favicons.cache.FaviconCacheSQLite.
Definition at line 197 of file cache.py.
FaviconCacheStats searx.favicons.cache.FaviconCache.state | ( | self | ) |
Returns a :py:obj:`FaviconCacheStats` (key/values) with information on the state of the cache.
Reimplemented in searx.favicons.cache.FaviconCacheMEM, searx.favicons.cache.FaviconCacheNull, and searx.favicons.cache.FaviconCacheSQLite.
Definition at line 202 of file cache.py.