.oO SearXNG Developer Documentation Oo.
|
Namespaces | |
namespace | client |
namespace | network |
namespace | raise_for_httperror |
Classes | |
class | Request |
Functions | |
reset_time_for_thread () | |
float|None | get_time_for_thread () |
set_timeout_for_thread (float timeout, float|None start_time=None) | |
set_context_network_name (str network_name) | |
"Network" | get_context_network () |
_record_http_time () | |
float | _get_timeout (float start_time, t.Any kwargs) |
SXNG_Response | request (str method, str url, **t.Any 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, dict[str, t.Any]|None data=None, **t.Any kwargs) |
SXNG_Response | put (str url, dict[str, t.Any]|None data=None, **t.Any kwargs) |
SXNG_Response | patch (str url, dict[str, t.Any]|None 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[SXNG_Response, Iterable[bytes]] | stream (str method, str url, **t.Any kwargs) |
Variables | |
list | __all__ = ["get_network", "initialize", "check_network_configuration", "raise_for_httperror"] |
THREADLOCAL = threading.local() | |
# pylint disable | _generator = protected-access |
|
protected |
Definition at line 245 of file __init__.py.
|
protected |
Definition at line 73 of file __init__.py.
Referenced by multi_requests(), and request().
|
protected |
Definition at line 59 of file __init__.py.
Referenced by multi_requests(), and request().
|
protected |
Definition at line 230 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 200 of file __init__.py.
References request().
SXNG_Response searx.network.get | ( | str | url, |
**t.Any | kwargs ) |
Definition at line 173 of file __init__.py.
References request().
"Network" searx.network.get_context_network | ( | ) |
If set return thread's network. If unset, return value from :py:obj:`get_network`.
Definition at line 50 of file __init__.py.
Referenced by _stream_generator(), multi_requests(), and request().
float | None searx.network.get_time_for_thread | ( | ) |
returns thread's total time or None
Definition at line 36 of file __init__.py.
SXNG_Response searx.network.head | ( | str | url, |
**t.Any | kwargs ) |
Definition at line 183 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 111 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 178 of file __init__.py.
References request().
SXNG_Response searx.network.patch | ( | str | url, |
dict[str, t.Any] | None | data = None, | ||
**t.Any | kwargs ) |
Definition at line 196 of file __init__.py.
References request().
SXNG_Response searx.network.post | ( | str | url, |
dict[str, t.Any] | None | data = None, | ||
**t.Any | kwargs ) |
Definition at line 188 of file __init__.py.
References request().
SXNG_Response searx.network.put | ( | str | url, |
dict[str, t.Any] | None | data = None, | ||
**t.Any | kwargs ) |
Definition at line 192 of file __init__.py.
References request().
SXNG_Response searx.network.request | ( | str | method, |
str | url, | ||
**t.Any | kwargs ) |
same as requests/requests/api.py request(...)
Definition at line 96 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 32 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.init_network_in_thread().
searx.network.set_context_network_name | ( | str | network_name | ) |
Definition at line 46 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.init_network_in_thread().
searx.network.set_timeout_for_thread | ( | float | timeout, |
float | None | start_time = None ) |
Definition at line 41 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.init_network_in_thread().
tuple[SXNG_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 255 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 204 of file __init__.py.
Referenced by _stream_generator().
|
private |
Definition at line 4 of file __init__.py.
|
protected |
Definition at line 251 of file __init__.py.
searx.network.THREADLOCAL = threading.local() |
Definition at line 28 of file __init__.py.