.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, cfg) | |
None|tuple[bytes|None, str|None] | __call__ (self, str resolver, str authority) |
bool | set (self, str resolver, str authority, str|None mime, bytes|None data) |
state (self) | |
maintenance (self, force=False) | |
Public Member Functions inherited from searx.favicons.cache.FaviconCache |
Public Attributes | |
cfg = cfg | |
Protected Attributes | |
dict | _data = {} |
dict | _sha_mime = {} |
Favicon cache in process' memory. Its just a POC that stores the favicons in the memory of the process. .. attention:: Don't use it in production, it will blow up your memory!!
searx.favicons.cache.FaviconCacheMEM.__init__ | ( | self, | |
cfg ) |
An instance of the favicon cache is build up from the configuration.
Reimplemented from searx.favicons.cache.FaviconCache.
Definition at line 437 of file cache.py.
None | tuple[bytes | None, str | None] searx.favicons.cache.FaviconCacheMEM.__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 from searx.favicons.cache.FaviconCache.
Definition at line 443 of file cache.py.
References searx.favicons.cache.FaviconCacheMEM._data, and searx.favicons.cache.FaviconCacheMEM._sha_mime.
searx.favicons.cache.FaviconCacheMEM.maintenance | ( | self, | |
force = False ) |
Performs maintenance on the cache
Reimplemented from searx.favicons.cache.FaviconCache.
Definition at line 475 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
bool searx.favicons.cache.FaviconCacheMEM.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 from searx.favicons.cache.FaviconCache.
Definition at line 453 of file cache.py.
References searx.favicons.cache.FaviconCacheMEM._data, and searx.favicons.cache.FaviconCacheMEM._sha_mime.
searx.favicons.cache.FaviconCacheMEM.state | ( | self | ) |
Returns a :py:obj:`FaviconCacheStats` (key/values) with information on the state of the cache.
Reimplemented from searx.favicons.cache.FaviconCache.
Definition at line 472 of file cache.py.
References searx.favicons.cache.FaviconCacheMEM._data.
|
protected |
Definition at line 440 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheMEM.__call__(), searx.favicons.cache.FaviconCacheMEM.set(), and searx.favicons.cache.FaviconCacheMEM.state().
|
protected |
Definition at line 441 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheMEM.__call__(), and searx.favicons.cache.FaviconCacheMEM.set().
searx.favicons.cache.FaviconCacheMEM.cfg = cfg |
Definition at line 439 of file cache.py.
Referenced by searx.botdetection.config.Config._get_parent_dict(), searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time(), searx.favicons.cache.FaviconCacheSQLite.set(), and searx.botdetection.config.Config.update().