.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) |
int | next_maintenance_time (self) |
maintenance (self, force=False) | |
FaviconCacheStats | state (self) |
Public Member Functions inherited from searx.sqlitedb.SQLiteAppl | |
sqlite3.Connection | connect (self) |
register_functions (self, conn) | |
sqlite3.Connection | DB (self) |
init (self) | |
create_schema (self, conn) | |
Public Member Functions inherited from searx.favicons.cache.FaviconCache |
Public Attributes | |
cfg = cfg | |
next_maintenance_time | |
Public Attributes inherited from searx.sqlitedb.SQLiteAppl | |
db_url = db_url | |
properties = SQLiteProperties(db_url) | |
thread_local = threading.local() | |
Static Public Attributes | |
int | DB_SCHEMA = 1 |
str | DDL_BLOBS |
str | DDL_BLOB_MAP |
dict | DDL_CREATE_TABLES |
tuple | SQL_DROP_LEFTOVER_BLOBS |
tuple | SQL_ITER_BLOBS_SHA256_BYTES_C |
tuple | SQL_INSERT_BLOBS |
tuple | SQL_INSERT_BLOB_MAP |
Static Public Attributes inherited from searx.sqlitedb.SQLiteAppl | |
dict | DDL_CREATE_TABLES = {} |
int | DB_SCHEMA = 1 |
dict | SQLITE_THREADING_MODE |
str | SQLITE_JOURNAL_MODE = "WAL" |
dict | SQLITE_CONNECT_ARGS |
Protected Member Functions | |
_query_val (self, sql, default=None) | |
Protected Member Functions inherited from searx.sqlitedb.SQLiteAppl | |
_compatibility (self) | |
Additional Inherited Members | |
Protected Attributes inherited from searx.sqlitedb.SQLiteAppl | |
bool | _init_done = False |
_DB = None | |
Favicon cache that manages the favicon BLOBs in a SQLite DB. The DB model in the SQLite DB is implemented using the abstract class :py:obj:`sqlitedb.SQLiteAppl`. The following configurations are required / supported: - :py:obj:`FaviconCacheConfig.db_url` - :py:obj:`FaviconCacheConfig.HOLD_TIME` - :py:obj:`FaviconCacheConfig.LIMIT_TOTAL_BYTES` - :py:obj:`FaviconCacheConfig.BLOB_MAX_BYTES` - :py:obj:`MAINTENANCE_PERIOD` - :py:obj:`MAINTENANCE_MODE`
searx.favicons.cache.FaviconCacheSQLite.__init__ | ( | self, | |
FaviconCacheConfig | cfg ) |
An instance of the favicon cache is build up from the configuration.
Reimplemented from searx.sqlitedb.SQLiteAppl.
Definition at line 304 of file cache.py.
References searx.favicons.cache.FaviconCacheSQLite.__init__().
Referenced by searx.favicons.cache.FaviconCacheSQLite.__init__().
None | tuple[None | bytes, None | str] searx.favicons.cache.FaviconCacheSQLite.__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 312 of file cache.py.
References searx.sqlitedb.SQLiteAppl.DB().
|
protected |
Definition at line 410 of file cache.py.
References searx.sqlitedb.SQLiteAppl.DB().
Referenced by searx.favicons.cache.FaviconCacheSQLite.state().
searx.favicons.cache.FaviconCacheSQLite.maintenance | ( | self, | |
force = False ) |
Performs maintenance on the cache
Reimplemented from searx.favicons.cache.FaviconCache.
Definition at line 369 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
int searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time | ( | self | ) |
Returns (unix epoch) time of the next maintenance.
Definition at line 364 of file cache.py.
References searx.botdetection.config.Config.cfg, searx.favicons.cache.FaviconCacheMEM.cfg, searx.favicons.cache.FaviconCacheSQLite.cfg, and searx.sqlitedb.SQLiteAppl.properties.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
bool searx.favicons.cache.FaviconCacheSQLite.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 330 of file cache.py.
References searx.botdetection.config.Config.cfg, searx.favicons.cache.FaviconCacheMEM.cfg, searx.favicons.cache.FaviconCacheSQLite.cfg, searx.sqlitedb.SQLiteAppl.connect(), searx.favicons.cache.FaviconCache.maintenance(), searx.favicons.cache.FaviconCacheMEM.maintenance(), searx.favicons.cache.FaviconCacheNull.maintenance(), searx.favicons.cache.FaviconCacheSQLite.maintenance(), searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time(), searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time, searx.favicons.cache.FaviconCacheSQLite.SQL_INSERT_BLOB_MAP, and searx.favicons.cache.FaviconCacheSQLite.SQL_INSERT_BLOBS.
FaviconCacheStats searx.favicons.cache.FaviconCacheSQLite.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 418 of file cache.py.
References searx.favicons.cache.FaviconCacheSQLite._query_val().
searx.favicons.cache.FaviconCacheSQLite.cfg = cfg |
Definition at line 310 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().
|
static |
Definition at line 249 of file cache.py.
Referenced by searx.sqlitedb.SQLiteAppl.create_schema(), and searx.sqlitedb.SQLiteAppl.init().
|
static |
|
static |
|
static |
Definition at line 271 of file cache.py.
Referenced by searx.sqlitedb.SQLiteAppl.create_schema().
searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time |
Definition at line 374 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
|
static |
|
static |
Definition at line 298 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
|
static |
Definition at line 293 of file cache.py.
Referenced by searx.favicons.cache.FaviconCacheSQLite.set().
|
static |