From 7cb4d455375926a754c3d7664db6f40b29825748 Mon Sep 17 00:00:00 2001 From: Untriex Programming Date: Thu, 4 Mar 2021 12:13:46 +0100 Subject: [PATCH] Heartbeat fastapi --- .gitignore | 500 +++++++++++++++++++++++++++++++++++++++++++++++++++++ main.py | 44 ++++- 2 files changed, 543 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e3012b9..b32da44 100644 --- a/.gitignore +++ b/.gitignore @@ -1070,3 +1070,503 @@ .venv/lib/python3.9/site-packages/setuptools/windows_support.py .venv/lib64 .venv/pyvenv.cfg +__pycache__/main.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/utilities.py +.venv/lib/python3.9/site-packages/wsproto/typing.py +.venv/lib/python3.9/site-packages/wsproto/py.typed +.venv/lib/python3.9/site-packages/wsproto/handshake.py +.venv/lib/python3.9/site-packages/wsproto/frame_protocol.py +.venv/lib/python3.9/site-packages/wsproto/extensions.py +.venv/lib/python3.9/site-packages/wsproto/events.py +.venv/lib/python3.9/site-packages/wsproto/connection.py +.venv/lib/python3.9/site-packages/wsproto/__pycache__/utilities.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/typing.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/handshake.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/frame_protocol.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/extensions.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/events.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/connection.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/wsproto/__init__.py +.venv/lib/python3.9/site-packages/wsproto-1.0.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/wsproto-1.0.0.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/wsproto-1.0.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/wsproto-1.0.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/wsproto-1.0.0.dist-info/LICENSE +.venv/lib/python3.9/site-packages/wsproto-1.0.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/typing_extensions.py +.venv/lib/python3.9/site-packages/typing_extensions-3.7.4.3.dist-info/WHEEL +.venv/lib/python3.9/site-packages/typing_extensions-3.7.4.3.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/typing_extensions-3.7.4.3.dist-info/RECORD +.venv/lib/python3.9/site-packages/typing_extensions-3.7.4.3.dist-info/METADATA +.venv/lib/python3.9/site-packages/typing_extensions-3.7.4.3.dist-info/LICENSE +.venv/lib/python3.9/site-packages/typing_extensions-3.7.4.3.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/toml/tz.py +.venv/lib/python3.9/site-packages/toml/ordered.py +.venv/lib/python3.9/site-packages/toml/encoder.py +.venv/lib/python3.9/site-packages/toml/decoder.py +.venv/lib/python3.9/site-packages/toml/__pycache__/tz.cpython-39.pyc +.venv/lib/python3.9/site-packages/toml/__pycache__/ordered.cpython-39.pyc +.venv/lib/python3.9/site-packages/toml/__pycache__/encoder.cpython-39.pyc +.venv/lib/python3.9/site-packages/toml/__pycache__/decoder.cpython-39.pyc +.venv/lib/python3.9/site-packages/toml/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/toml/__init__.py +.venv/lib/python3.9/site-packages/toml-0.10.2.dist-info/WHEEL +.venv/lib/python3.9/site-packages/toml-0.10.2.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/toml-0.10.2.dist-info/RECORD +.venv/lib/python3.9/site-packages/toml-0.10.2.dist-info/METADATA +.venv/lib/python3.9/site-packages/toml-0.10.2.dist-info/LICENSE +.venv/lib/python3.9/site-packages/toml-0.10.2.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/starlette/websockets.py +.venv/lib/python3.9/site-packages/starlette/types.py +.venv/lib/python3.9/site-packages/starlette/testclient.py +.venv/lib/python3.9/site-packages/starlette/templating.py +.venv/lib/python3.9/site-packages/starlette/status.py +.venv/lib/python3.9/site-packages/starlette/staticfiles.py +.venv/lib/python3.9/site-packages/starlette/schemas.py +.venv/lib/python3.9/site-packages/starlette/routing.py +.venv/lib/python3.9/site-packages/starlette/responses.py +.venv/lib/python3.9/site-packages/starlette/requests.py +.venv/lib/python3.9/site-packages/starlette/py.typed +.venv/lib/python3.9/site-packages/starlette/middleware/wsgi.py +.venv/lib/python3.9/site-packages/starlette/middleware/trustedhost.py +.venv/lib/python3.9/site-packages/starlette/middleware/sessions.py +.venv/lib/python3.9/site-packages/starlette/middleware/httpsredirect.py +.venv/lib/python3.9/site-packages/starlette/middleware/gzip.py +.venv/lib/python3.9/site-packages/starlette/middleware/errors.py +.venv/lib/python3.9/site-packages/starlette/middleware/cors.py +.venv/lib/python3.9/site-packages/starlette/middleware/base.py +.venv/lib/python3.9/site-packages/starlette/middleware/authentication.py +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/wsgi.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/trustedhost.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/sessions.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/httpsredirect.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/gzip.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/errors.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/cors.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/base.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/authentication.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/middleware/__init__.py +.venv/lib/python3.9/site-packages/starlette/graphql.py +.venv/lib/python3.9/site-packages/starlette/formparsers.py +.venv/lib/python3.9/site-packages/starlette/exceptions.py +.venv/lib/python3.9/site-packages/starlette/endpoints.py +.venv/lib/python3.9/site-packages/starlette/datastructures.py +.venv/lib/python3.9/site-packages/starlette/convertors.py +.venv/lib/python3.9/site-packages/starlette/config.py +.venv/lib/python3.9/site-packages/starlette/concurrency.py +.venv/lib/python3.9/site-packages/starlette/background.py +.venv/lib/python3.9/site-packages/starlette/authentication.py +.venv/lib/python3.9/site-packages/starlette/applications.py +.venv/lib/python3.9/site-packages/starlette/__pycache__/websockets.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/types.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/testclient.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/templating.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/status.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/staticfiles.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/schemas.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/routing.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/responses.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/requests.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/graphql.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/formparsers.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/exceptions.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/endpoints.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/datastructures.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/convertors.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/config.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/concurrency.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/background.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/authentication.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/applications.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/starlette/__init__.py +.venv/lib/python3.9/site-packages/starlette-0.13.6.dist-info/WHEEL +.venv/lib/python3.9/site-packages/starlette-0.13.6.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/starlette-0.13.6.dist-info/RECORD +.venv/lib/python3.9/site-packages/starlette-0.13.6.dist-info/METADATA +.venv/lib/python3.9/site-packages/starlette-0.13.6.dist-info/LICENSE.md +.venv/lib/python3.9/site-packages/starlette-0.13.6.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/pydantic/version.py +.venv/lib/python3.9/site-packages/pydantic/version.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/validators.py +.venv/lib/python3.9/site-packages/pydantic/validators.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/utils.py +.venv/lib/python3.9/site-packages/pydantic/utils.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/typing.py +.venv/lib/python3.9/site-packages/pydantic/typing.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/types.py +.venv/lib/python3.9/site-packages/pydantic/types.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/tools.py +.venv/lib/python3.9/site-packages/pydantic/tools.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/schema.py +.venv/lib/python3.9/site-packages/pydantic/schema.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/py.typed +.venv/lib/python3.9/site-packages/pydantic/parse.py +.venv/lib/python3.9/site-packages/pydantic/parse.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/networks.py +.venv/lib/python3.9/site-packages/pydantic/networks.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/mypy.py +.venv/lib/python3.9/site-packages/pydantic/mypy.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/main.py +.venv/lib/python3.9/site-packages/pydantic/main.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/json.py +.venv/lib/python3.9/site-packages/pydantic/json.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/generics.py +.venv/lib/python3.9/site-packages/pydantic/fields.py +.venv/lib/python3.9/site-packages/pydantic/fields.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/errors.py +.venv/lib/python3.9/site-packages/pydantic/errors.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/error_wrappers.py +.venv/lib/python3.9/site-packages/pydantic/error_wrappers.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/env_settings.py +.venv/lib/python3.9/site-packages/pydantic/env_settings.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/decorator.py +.venv/lib/python3.9/site-packages/pydantic/decorator.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/datetime_parse.py +.venv/lib/python3.9/site-packages/pydantic/datetime_parse.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/dataclasses.py +.venv/lib/python3.9/site-packages/pydantic/dataclasses.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/color.py +.venv/lib/python3.9/site-packages/pydantic/color.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/class_validators.py +.venv/lib/python3.9/site-packages/pydantic/class_validators.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/annotated_types.py +.venv/lib/python3.9/site-packages/pydantic/annotated_types.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/_hypothesis_plugin.py +.venv/lib/python3.9/site-packages/pydantic/_hypothesis_plugin.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic/__pycache__/version.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/validators.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/utils.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/typing.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/types.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/tools.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/schema.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/parse.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/networks.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/mypy.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/main.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/json.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/generics.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/fields.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/errors.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/error_wrappers.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/env_settings.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/decorator.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/datetime_parse.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/dataclasses.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/color.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/class_validators.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/annotated_types.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/_hypothesis_plugin.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/pydantic/__init__.py +.venv/lib/python3.9/site-packages/pydantic/__init__.cpython-39-x86_64-linux-gnu.so +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/WHEEL +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/RECORD +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/METADATA +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/LICENSE +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/pydantic-1.8.1.dist-info/entry_points.txt +.venv/lib/python3.9/site-packages/priority/priority.py +.venv/lib/python3.9/site-packages/priority/__pycache__/priority.cpython-39.pyc +.venv/lib/python3.9/site-packages/priority/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/priority/__init__.py +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/metadata.json +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/priority-1.3.0.dist-info/DESCRIPTION.rst +.venv/lib/python3.9/site-packages/hyperframe/frame.py +.venv/lib/python3.9/site-packages/hyperframe/flags.py +.venv/lib/python3.9/site-packages/hyperframe/exceptions.py +.venv/lib/python3.9/site-packages/hyperframe/__pycache__/frame.cpython-39.pyc +.venv/lib/python3.9/site-packages/hyperframe/__pycache__/flags.cpython-39.pyc +.venv/lib/python3.9/site-packages/hyperframe/__pycache__/exceptions.cpython-39.pyc +.venv/lib/python3.9/site-packages/hyperframe/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hyperframe/__init__.py +.venv/lib/python3.9/site-packages/hyperframe-6.0.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/hyperframe-6.0.0.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/hyperframe-6.0.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/hyperframe-6.0.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/hyperframe-6.0.0.dist-info/LICENSE +.venv/lib/python3.9/site-packages/hyperframe-6.0.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/hypercorn/utils.py +.venv/lib/python3.9/site-packages/hypercorn/typing.py +.venv/lib/python3.9/site-packages/hypercorn/trio/udp_server.py +.venv/lib/python3.9/site-packages/hypercorn/trio/tcp_server.py +.venv/lib/python3.9/site-packages/hypercorn/trio/statsd.py +.venv/lib/python3.9/site-packages/hypercorn/trio/run.py +.venv/lib/python3.9/site-packages/hypercorn/trio/lifespan.py +.venv/lib/python3.9/site-packages/hypercorn/trio/context.py +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/udp_server.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/tcp_server.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/statsd.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/run.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/lifespan.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/context.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/trio/__init__.py +.venv/lib/python3.9/site-packages/hypercorn/statsd.py +.venv/lib/python3.9/site-packages/hypercorn/run.py +.venv/lib/python3.9/site-packages/hypercorn/py.typed +.venv/lib/python3.9/site-packages/hypercorn/protocol/ws_stream.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/quic.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/http_stream.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/h3.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/h2.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/h11.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/events.py +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/ws_stream.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/quic.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/http_stream.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/h3.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/h2.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/h11.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/events.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/protocol/__init__.py +.venv/lib/python3.9/site-packages/hypercorn/middleware/wsgi.py +.venv/lib/python3.9/site-packages/hypercorn/middleware/http_to_https.py +.venv/lib/python3.9/site-packages/hypercorn/middleware/dispatcher.py +.venv/lib/python3.9/site-packages/hypercorn/middleware/__pycache__/wsgi.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/middleware/__pycache__/http_to_https.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/middleware/__pycache__/dispatcher.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/middleware/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/middleware/__init__.py +.venv/lib/python3.9/site-packages/hypercorn/logging.py +.venv/lib/python3.9/site-packages/hypercorn/events.py +.venv/lib/python3.9/site-packages/hypercorn/config.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/udp_server.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/tcp_server.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/task_group.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/statsd.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/run.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/lifespan.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/context.py +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/udp_server.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/tcp_server.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/task_group.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/statsd.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/run.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/lifespan.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/context.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/asyncio/__init__.py +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/utils.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/typing.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/statsd.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/run.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/logging.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/events.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/config.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/__main__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__pycache__/__about__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hypercorn/__main__.py +.venv/lib/python3.9/site-packages/hypercorn/__init__.py +.venv/lib/python3.9/site-packages/hypercorn/__about__.py +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/WHEEL +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/REQUESTED +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/RECORD +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/METADATA +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/LICENSE +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/Hypercorn-0.11.2.dist-info/entry_points.txt +.venv/lib/python3.9/site-packages/hpack/table.py +.venv/lib/python3.9/site-packages/hpack/struct.py +.venv/lib/python3.9/site-packages/hpack/huffman_table.py +.venv/lib/python3.9/site-packages/hpack/huffman_constants.py +.venv/lib/python3.9/site-packages/hpack/huffman.py +.venv/lib/python3.9/site-packages/hpack/hpack.py +.venv/lib/python3.9/site-packages/hpack/exceptions.py +.venv/lib/python3.9/site-packages/hpack/__pycache__/table.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/struct.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/huffman_table.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/huffman_constants.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/huffman.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/hpack.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/exceptions.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/hpack/__init__.py +.venv/lib/python3.9/site-packages/hpack-4.0.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/hpack-4.0.0.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/hpack-4.0.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/hpack-4.0.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/hpack-4.0.0.dist-info/LICENSE +.venv/lib/python3.9/site-packages/hpack-4.0.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/h2/windows.py +.venv/lib/python3.9/site-packages/h2/utilities.py +.venv/lib/python3.9/site-packages/h2/stream.py +.venv/lib/python3.9/site-packages/h2/settings.py +.venv/lib/python3.9/site-packages/h2/frame_buffer.py +.venv/lib/python3.9/site-packages/h2/exceptions.py +.venv/lib/python3.9/site-packages/h2/events.py +.venv/lib/python3.9/site-packages/h2/errors.py +.venv/lib/python3.9/site-packages/h2/connection.py +.venv/lib/python3.9/site-packages/h2/config.py +.venv/lib/python3.9/site-packages/h2/__pycache__/windows.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/utilities.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/stream.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/settings.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/frame_buffer.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/exceptions.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/events.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/errors.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/connection.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/config.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/h2/__init__.py +.venv/lib/python3.9/site-packages/h2-4.0.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/h2-4.0.0.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/h2-4.0.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/h2-4.0.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/h2-4.0.0.dist-info/LICENSE +.venv/lib/python3.9/site-packages/h2-4.0.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/h11/tests/test_util.py +.venv/lib/python3.9/site-packages/h11/tests/test_state.py +.venv/lib/python3.9/site-packages/h11/tests/test_receivebuffer.py +.venv/lib/python3.9/site-packages/h11/tests/test_io.py +.venv/lib/python3.9/site-packages/h11/tests/test_helpers.py +.venv/lib/python3.9/site-packages/h11/tests/test_headers.py +.venv/lib/python3.9/site-packages/h11/tests/test_events.py +.venv/lib/python3.9/site-packages/h11/tests/test_connection.py +.venv/lib/python3.9/site-packages/h11/tests/test_against_stdlib_http.py +.venv/lib/python3.9/site-packages/h11/tests/helpers.py +.venv/lib/python3.9/site-packages/h11/tests/data/test-file +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_util.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_state.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_receivebuffer.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_io.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_helpers.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_headers.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_events.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_connection.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/test_against_stdlib_http.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/helpers.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/tests/__init__.py +.venv/lib/python3.9/site-packages/h11/_writers.py +.venv/lib/python3.9/site-packages/h11/_version.py +.venv/lib/python3.9/site-packages/h11/_util.py +.venv/lib/python3.9/site-packages/h11/_state.py +.venv/lib/python3.9/site-packages/h11/_receivebuffer.py +.venv/lib/python3.9/site-packages/h11/_readers.py +.venv/lib/python3.9/site-packages/h11/_headers.py +.venv/lib/python3.9/site-packages/h11/_events.py +.venv/lib/python3.9/site-packages/h11/_connection.py +.venv/lib/python3.9/site-packages/h11/_abnf.py +.venv/lib/python3.9/site-packages/h11/__pycache__/_writers.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_version.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_util.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_state.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_receivebuffer.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_readers.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_headers.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_events.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_connection.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/_abnf.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/h11/__init__.py +.venv/lib/python3.9/site-packages/h11-0.12.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/h11-0.12.0.dist-info/top_level.txt +.venv/lib/python3.9/site-packages/h11-0.12.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/h11-0.12.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/h11-0.12.0.dist-info/LICENSE.txt +.venv/lib/python3.9/site-packages/h11-0.12.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/fastapi/websockets.py +.venv/lib/python3.9/site-packages/fastapi/utils.py +.venv/lib/python3.9/site-packages/fastapi/types.py +.venv/lib/python3.9/site-packages/fastapi/testclient.py +.venv/lib/python3.9/site-packages/fastapi/templating.py +.venv/lib/python3.9/site-packages/fastapi/staticfiles.py +.venv/lib/python3.9/site-packages/fastapi/security/utils.py +.venv/lib/python3.9/site-packages/fastapi/security/open_id_connect_url.py +.venv/lib/python3.9/site-packages/fastapi/security/oauth2.py +.venv/lib/python3.9/site-packages/fastapi/security/http.py +.venv/lib/python3.9/site-packages/fastapi/security/base.py +.venv/lib/python3.9/site-packages/fastapi/security/api_key.py +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/utils.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/open_id_connect_url.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/oauth2.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/http.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/base.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/api_key.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/security/__init__.py +.venv/lib/python3.9/site-packages/fastapi/routing.py +.venv/lib/python3.9/site-packages/fastapi/responses.py +.venv/lib/python3.9/site-packages/fastapi/requests.py +.venv/lib/python3.9/site-packages/fastapi/py.typed +.venv/lib/python3.9/site-packages/fastapi/params.py +.venv/lib/python3.9/site-packages/fastapi/param_functions.py +.venv/lib/python3.9/site-packages/fastapi/openapi/utils.py +.venv/lib/python3.9/site-packages/fastapi/openapi/models.py +.venv/lib/python3.9/site-packages/fastapi/openapi/docs.py +.venv/lib/python3.9/site-packages/fastapi/openapi/constants.py +.venv/lib/python3.9/site-packages/fastapi/openapi/__pycache__/utils.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/openapi/__pycache__/models.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/openapi/__pycache__/docs.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/openapi/__pycache__/constants.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/openapi/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/openapi/__init__.py +.venv/lib/python3.9/site-packages/fastapi/middleware/wsgi.py +.venv/lib/python3.9/site-packages/fastapi/middleware/trustedhost.py +.venv/lib/python3.9/site-packages/fastapi/middleware/httpsredirect.py +.venv/lib/python3.9/site-packages/fastapi/middleware/gzip.py +.venv/lib/python3.9/site-packages/fastapi/middleware/cors.py +.venv/lib/python3.9/site-packages/fastapi/middleware/__pycache__/wsgi.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/middleware/__pycache__/trustedhost.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/middleware/__pycache__/httpsredirect.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/middleware/__pycache__/gzip.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/middleware/__pycache__/cors.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/middleware/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/middleware/__init__.py +.venv/lib/python3.9/site-packages/fastapi/logger.py +.venv/lib/python3.9/site-packages/fastapi/exceptions.py +.venv/lib/python3.9/site-packages/fastapi/exception_handlers.py +.venv/lib/python3.9/site-packages/fastapi/encoders.py +.venv/lib/python3.9/site-packages/fastapi/dependencies/utils.py +.venv/lib/python3.9/site-packages/fastapi/dependencies/models.py +.venv/lib/python3.9/site-packages/fastapi/dependencies/__pycache__/utils.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/dependencies/__pycache__/models.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/dependencies/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/dependencies/__init__.py +.venv/lib/python3.9/site-packages/fastapi/datastructures.py +.venv/lib/python3.9/site-packages/fastapi/concurrency.py +.venv/lib/python3.9/site-packages/fastapi/background.py +.venv/lib/python3.9/site-packages/fastapi/applications.py +.venv/lib/python3.9/site-packages/fastapi/__pycache__/websockets.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/utils.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/types.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/testclient.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/templating.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/staticfiles.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/routing.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/responses.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/requests.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/params.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/param_functions.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/logger.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/exceptions.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/exception_handlers.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/encoders.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/datastructures.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/concurrency.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/background.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/applications.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__pycache__/__init__.cpython-39.pyc +.venv/lib/python3.9/site-packages/fastapi/__init__.py +.venv/lib/python3.9/site-packages/fastapi-0.63.0.dist-info/WHEEL +.venv/lib/python3.9/site-packages/fastapi-0.63.0.dist-info/REQUESTED +.venv/lib/python3.9/site-packages/fastapi-0.63.0.dist-info/RECORD +.venv/lib/python3.9/site-packages/fastapi-0.63.0.dist-info/METADATA +.venv/lib/python3.9/site-packages/fastapi-0.63.0.dist-info/LICENSE +.venv/lib/python3.9/site-packages/fastapi-0.63.0.dist-info/INSTALLER +.venv/lib/python3.9/site-packages/__pycache__/typing_extensions.cpython-39.pyc +.venv/bin/hypercorn diff --git a/main.py b/main.py index 1ff8e07..3b1b4cc 100644 --- a/main.py +++ b/main.py @@ -1 +1,43 @@ -print("test") +from fastapi import FastAPI +from pydantic import BaseModel + +app = FastAPI() +location = "izba" +ID = 55 +IP = "192.168.1.25" +filesystem = { + "otvaracie_hod": ["t", {"pon": "10-25"}, {"uto": "10-25"}], + "prehliadka": ["pdf", "/files/prehliadka.pdf"], + "fotky_hrad": ["png_z", ["/files/hrad1.png", "/files/hrad2.png"]] +} +heartbeat_table = { + "ID": [1, 2, 3, 4, 5, 6, 7], + "IP": ["192.168.1.11", "192.168.1.12", "192.168.1.13", "192.168.1.14", "192.168.1.16", "192.168.1.17"], + "location": ["1", "2", "3", "4", "5", "6", "hrad"], + "file_system": ["x", "x", "x", "x", "x", "x", "x"], + "last_heartbeat": [15, 15, 15, 15, 15, 15, 15] +} + + +class Server_table(BaseModel): + ID: list + IP: list + location: list + file_system: list + last_heartbeat: list + + +@app.post("/heartbeat") +def heartbeat(s_table: Server_table): + for position, server_id in enumerate(s_table.ID): + if server_id in heartbeat_table["ID"]: + if heartbeat_table["last_heartbeat"][heartbeat_table["ID"].index(server_id)] > s_table.last_heartbeat[position]: + heartbeat_table["last_heartbeat"][heartbeat_table["ID"].index(server_id)] = s_table.last_heartbeat[position] + else: + heartbeat_table["ID"].append(s_table.ID[position]) + heartbeat_table["IP"].append(s_table.IP[position]) + heartbeat_table["location"].append(s_table.location[position]) + heartbeat_table["file_system"].append(s_table.file_system[position]) + heartbeat_table["last_heartbeat"].append(s_table.last_heartbeat[position]) + print(heartbeat_table) + return heartbeat_table, {"ID": ID, "file_system": filesystem, "location": location} \ No newline at end of file