.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 (timeout, start_time=None) | |
set_context_network_name (network_name) | |
get_context_network () | |
_record_http_time () | |
_get_timeout (start_time, kwargs) | |
request (method, url, **kwargs) | |
List[Union[httpx.Response, Exception]] | multi_requests (List["Request"] request_list) |
get (url, **kwargs) | |
options (url, **kwargs) | |
head (url, **kwargs) | |
post (url, data=None, **kwargs) | |
put (url, data=None, **kwargs) | |
patch (url, data=None, **kwargs) | |
delete (url, **kwargs) | |
stream_chunk_to_queue (network, queue, method, url, **kwargs) | |
_stream_generator (method, url, **kwargs) | |
_close_response_method (self) | |
Tuple[httpx.Response, Iterable[bytes]] | stream (method, url, **kwargs) |
Variables | |
THREADLOCAL = threading.local() | |
# pylint disable | _generator = protected-access |
|
protected |
Definition at line 234 of file __init__.py.
|
protected |
Definition at line 66 of file __init__.py.
Referenced by searx.network.multi_requests(), and searx.network.request().
|
protected |
Definition at line 52 of file __init__.py.
Referenced by searx.network.multi_requests(), and searx.network.request().
|
protected |
Definition at line 219 of file __init__.py.
References searx.network.get_context_network(), and searx.network.stream_chunk_to_queue().
Referenced by searx.network.stream().
searx.network.delete | ( | url, | |
** | kwargs ) |
Definition at line 189 of file __init__.py.
References searx.network.request().
searx.network.get | ( | url, | |
** | kwargs ) |
Definition at line 162 of file __init__.py.
References searx.network.request().
searx.network.get_context_network | ( | ) |
If set return thread's network. If unset, return value from :py:obj:`get_network`.
Definition at line 43 of file __init__.py.
Referenced by searx.network._stream_generator(), searx.network.multi_requests(), and searx.network.request().
searx.network.get_time_for_thread | ( | ) |
returns thread's total time or None
Definition at line 29 of file __init__.py.
searx.network.head | ( | url, | |
** | kwargs ) |
Definition at line 172 of file __init__.py.
References searx.network.request().
List[Union[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 100 of file __init__.py.
References searx.network._get_timeout(), searx.network._record_http_time(), and searx.network.get_context_network().
searx.network.options | ( | url, | |
** | kwargs ) |
Definition at line 167 of file __init__.py.
References searx.network.request().
searx.network.patch | ( | url, | |
data = None, | |||
** | kwargs ) |
Definition at line 185 of file __init__.py.
References searx.network.request().
searx.network.post | ( | url, | |
data = None, | |||
** | kwargs ) |
Definition at line 177 of file __init__.py.
References searx.network.request().
searx.network.put | ( | url, | |
data = None, | |||
** | kwargs ) |
Definition at line 181 of file __init__.py.
References searx.network.request().
searx.network.request | ( | method, | |
url, | |||
** | kwargs ) |
same as requests/requests/api.py request(...)
Definition at line 88 of file __init__.py.
References searx.network._get_timeout(), searx.network._record_http_time(), and searx.network.get_context_network().
Referenced by searx.network.delete(), searx.network.get(), searx.network.head(), searx.network.options(), searx.network.patch(), searx.network.post(), and searx.network.put().
searx.network.reset_time_for_thread | ( | ) |
Definition at line 25 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 | ( | network_name | ) |
Definition at line 39 of file __init__.py.
Referenced by searx.search.processors.online.OnlineProcessor.search().
searx.network.set_timeout_for_thread | ( | timeout, | |
start_time = None ) |
Definition at line 34 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 | ( | method, | |
url, | |||
** | 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 244 of file __init__.py.
References searx.network._stream_generator().
searx.network.stream_chunk_to_queue | ( | network, | |
queue, | |||
method, | |||
url, | |||
** | kwargs ) |
Definition at line 193 of file __init__.py.
Referenced by searx.network._stream_generator().
|
protected |
Definition at line 240 of file __init__.py.
searx.network.THREADLOCAL = threading.local() |
Definition at line 21 of file __init__.py.