|
.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, bool force=False) | |
| FaviconCacheStats | state (self) |
| Public Member Functions inherited from searx.sqlitedb.SQLiteAppl | |
| __init__ (self, str db_url) | |
| sqlite3.Connection | connect (self) |
| register_functions (self, sqlite3.Connection conn) | |
| sqlite3.Connection | DB (self) |
| bool | init (self, sqlite3.Connection conn) |
| create_schema (self, sqlite3.Connection conn) | |
| Public Member Functions inherited from searx.favicons.cache.FaviconCache | |
| __init__ (self, FaviconCacheConfig cfg) | |
| None|tuple[None|bytes, None|str] | __call__ (self, str resolver, str authority) |
Public Attributes | |
| cfg = cfg | |
| next_maintenance_time | |
| Public Attributes inherited from searx.sqlitedb.SQLiteAppl | |
| str | db_url = db_url |
| SQLiteProperties | properties = SQLiteProperties(db_url) |
Static Public Attributes | |
| str | DDL_BLOBS |
| str | DDL_BLOB_MAP |
| 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, str sql, t.Any default=None) | |
| Protected Member Functions inherited from searx.sqlitedb.SQLiteAppl | |
| _compatibility (self) | |
| sqlite3.Connection | _connect (self) |
Additional Inherited Members | |
| Protected Attributes inherited from searx.sqlitedb.SQLiteAppl | |
| bool | _init_done = False |
| sqlite3.Connection|None | _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`.
For introspection of the DB, jump into developer environment and run command
to show cache state::
$ ./manage pyenv.cmd bash --norc --noprofile
(py3) python -m searx.favicons cache state
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.
Definition at line 312 of file cache.py.
References __init__().
Referenced by __init__().
| None | tuple[None | bytes, None | str] searx.favicons.cache.FaviconCacheSQLite.__call__ | ( | self, | |
| str | resolver, | ||
| str | authority ) |
Definition at line 320 of file cache.py.
References searx.cache.ExpireCacheSQLite.DB, searx.sqlitedb.SQLiteAppl.DB(), and searx.sqlitedb.SQLiteProperties.DB.
|
protected |
Definition at line 429 of file cache.py.
References searx.cache.ExpireCacheSQLite.DB, searx.sqlitedb.SQLiteAppl.DB(), and searx.sqlitedb.SQLiteProperties.DB.
Referenced by state().
| searx.favicons.cache.FaviconCacheSQLite.maintenance | ( | self, | |
| bool | force = False ) |
Performs maintenance on the cache
Reimplemented from searx.favicons.cache.FaviconCache.
Definition at line 381 of file cache.py.
| int searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time | ( | self | ) |
Returns (unix epoch) time of the next maintenance.
Definition at line 376 of file cache.py.
References searx.botdetection.config.Config.cfg, searx.cache.ExpireCacheSQLite.cfg, cfg, and searx.sqlitedb.SQLiteAppl.properties.
| 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 338 of file cache.py.
References searx.botdetection.config.Config.cfg, searx.cache.ExpireCacheSQLite.cfg, cfg, searx.sqlitedb.SQLiteAppl.connect(), searx.cache.ExpireCache.maintenance(), searx.cache.ExpireCacheSQLite.maintenance(), searx.favicons.cache.FaviconCache.maintenance(), searx.cache.ExpireCacheSQLite.next_maintenance_time, next_maintenance_time, SQL_INSERT_BLOB_MAP, and 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 437 of file cache.py.
References _query_val().
| searx.favicons.cache.FaviconCacheSQLite.cfg = cfg |
Definition at line 318 of file cache.py.
Referenced by next_maintenance_time(), searx.cache.ExpireCache.secret_hash(), and set().
|
static |
|
static |
| searx.favicons.cache.FaviconCacheSQLite.next_maintenance_time |
|
static |
|
static |
|
static |
|
static |