.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.favicons.cache.FaviconCacheNull Class Reference
+ Inheritance diagram for searx.favicons.cache.FaviconCacheNull:
+ Collaboration diagram for searx.favicons.cache.FaviconCacheNull:

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)
 
 state (self)
 
 maintenance (self, force=False)
 
- Public Member Functions inherited from searx.favicons.cache.FaviconCache

Detailed Description

A dummy favicon cache that caches nothing / a fallback solution. The
NullCache is used when more efficient caches such as the
:py:obj:`FaviconCacheSQLite` cannot be used because, for example, the SQLite
library is only available in an old version and does not meet the
requirements.

Definition at line 211 of file cache.py.

Constructor & Destructor Documentation

◆ __init__()

searx.favicons.cache.FaviconCacheNull.__init__ ( self,
FaviconCacheConfig cfg )
An instance of the favicon cache is build up from the configuration.

Reimplemented from searx.favicons.cache.FaviconCache.

Definition at line 218 of file cache.py.

218 def __init__(self, cfg: FaviconCacheConfig):
219 return None
220

Member Function Documentation

◆ __call__()

None | tuple[None | bytes, None | str] searx.favicons.cache.FaviconCacheNull.__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 221 of file cache.py.

221 def __call__(self, resolver: str, authority: str) -> None | tuple[None | bytes, None | str]:
222 return None
223

◆ maintenance()

searx.favicons.cache.FaviconCacheNull.maintenance ( self,
force = False )
Performs maintenance on the cache

Reimplemented from searx.favicons.cache.FaviconCache.

Definition at line 230 of file cache.py.

230 def maintenance(self, force=False):
231 pass
232
233

Referenced by searx.favicons.cache.FaviconCacheSQLite.set().

+ Here is the caller graph for this function:

◆ set()

bool searx.favicons.cache.FaviconCacheNull.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 224 of file cache.py.

224 def set(self, resolver: str, authority: str, mime: str | None, data: bytes | None) -> bool:
225 return False
226

◆ state()

searx.favicons.cache.FaviconCacheNull.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 227 of file cache.py.

227 def state(self):
228 return FaviconCacheStats(favicons=0)
229

The documentation for this class was generated from the following file: