.oO SearXNG Developer Documentation Oo.
|
Namespaces | |
namespace | client |
namespace | network |
namespace | raise_for_httperror |
Classes | |
class | Request |
Functions | |
reset_time_for_thread () | |
get_time_for_thread () | |
set_timeout_for_thread (float timeout, float|None start_time=None) | |
set_context_network_name (str network_name) | |
get_context_network () | |
_record_http_time () | |
_get_timeout (float start_time, kwargs) | |
SXNG_Response | request (method, url, **kwargs) |
list[httpx.Response|Exception] | multi_requests (list["Request"] request_list) |
SXNG_Response | get (str url, **t.Any kwargs) |
SXNG_Response | options (str url, **t.Any kwargs) |
SXNG_Response | head (str url, **t.Any kwargs) |
SXNG_Response | post (str url, data=None, **t.Any kwargs) |
SXNG_Response | put (str url, data=None, **t.Any kwargs) |
SXNG_Response | patch (str url, data=None, **t.Any kwargs) |
SXNG_Response | delete (str url, **t.Any kwargs) |
stream_chunk_to_queue (network, queue, str method, str url, **t.Any kwargs) | |
_stream_generator (str method, str url, **t.Any kwargs) | |
_close_response_method (self) | |
tuple[httpx.Response, Iterable[bytes]] | stream (str method, str url, **t.Any kwargs) |
Variables | |
list | __all__ = ["initialize", "check_network_configuration", "raise_for_httperror"] |
THREADLOCAL = threading.local() | |
# pylint disable | _generator = protected-access |
|
protected |
Definition at line 243 of file __init__.py.
|
protected |
Definition at line 71 of file __init__.py.
Referenced by multi_requests(), and request().
|
protected |
Definition at line 57 of file __init__.py.
Referenced by multi_requests(), and request().
|
protected |
Definition at line 228 of file __init__.py.
References get_context_network(), and stream_chunk_to_queue().
Referenced by stream().
SXNG_Response searx.network.delete | ( | str | url, |
**t.Any | kwargs ) |
Definition at line 198 of file __init__.py.
References request().
SXNG_Response searx.network.get | ( | str | url, |
**t.Any | kwargs ) |
Definition at line 171 of file __init__.py.
References request().
searx.network.get_context_network | ( | ) |
If set return thread's network. If unset, return value from :py:obj:`get_network`.
Definition at line 48 of file __init__.py.
Referenced by _stream_generator(), multi_requests(), and request().
searx.network.get_time_for_thread | ( | ) |
returns thread's total time or None
Definition at line 34 of file __init__.py.
SXNG_Response searx.network.head | ( | str | url, |
**t.Any | kwargs ) |
Definition at line 181 of file __init__.py.
References request().
list[httpx.Response | Exception] searx.network.multi_requests | ( | list["Request"] | request_list | ) |
send multiple HTTP requests in parallel. Wait for all requests to finish.
Definition at line 109 of file __init__.py.
References _get_timeout(), _record_http_time(), and get_context_network().
SXNG_Response searx.network.options | ( | str | url, |
**t.Any | kwargs ) |
Definition at line 176 of file __init__.py.
References request().
SXNG_Response searx.network.patch | ( | str | url, |
data = None, | |||
**t.Any | kwargs ) |
Definition at line 194 of file __init__.py.
References request().
SXNG_Response searx.network.post | ( | str | url, |
data = None, | |||
**t.Any | kwargs ) |
Definition at line 186 of file __init__.py.
References request().
SXNG_Response searx.network.put | ( | str | url, |
data = None, | |||
**t.Any | kwargs ) |
Definition at line 190 of file __init__.py.
References request().
SXNG_Response searx.network.request | ( | method, | |
url, | |||
** | kwargs ) |
same as requests/requests/api.py request(...)
Definition at line 94 of file __init__.py.
References _get_timeout(), _record_http_time(), and get_context_network().
Referenced by delete(), get(), head(), options(), patch(), post(), and put().
searx.network.reset_time_for_thread | ( | ) |
Definition at line 30 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.initialize(), and searx.search.processors.online.OnlineProcessor.search().
searx.network.set_context_network_name | ( | str | network_name | ) |
Definition at line 44 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.search().
searx.network.set_timeout_for_thread | ( | float | timeout, |
float | None | start_time = None ) |
Definition at line 39 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.initialize(), and searx.search.processors.online.OnlineProcessor.search().
tuple[httpx.Response, Iterable[bytes]] searx.network.stream | ( | str | method, |
str | url, | ||
**t.Any | kwargs ) |
Replace httpx.stream. Usage: response, stream = poolrequests.stream(...) for chunk in stream: ... httpx.Client.stream requires to write the httpx.HTTPTransport version of the the httpx.AsyncHTTPTransport declared above.
Definition at line 253 of file __init__.py.
References _stream_generator().
searx.network.stream_chunk_to_queue | ( | network, | |
queue, | |||
str | method, | ||
str | url, | ||
**t.Any | kwargs ) |
Definition at line 202 of file __init__.py.
Referenced by _stream_generator().
|
private |
Definition at line 4 of file __init__.py.
|
protected |
Definition at line 249 of file __init__.py.
searx.network.THREADLOCAL = threading.local() |
Definition at line 26 of file __init__.py.