project structure done

This commit is contained in:
2020-07-18 12:34:52 +02:00
parent 5b54d365dc
commit 940792c9b7
15 changed files with 424 additions and 0 deletions

25
src/app.py Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python3
import logging
import sentry_sdk
from config import *
"""
Main entry point
"""
__author__ = "@tormakris"
__copyright__ = "Copyright 2020, Birbnetes Team"
__module_name__ = "app"
__version__text__ = "1"
if SENTRY_DSN:
sentry_sdk.init(
dsn=SENTRY_DSN,
send_default_pii=True,
release=RELEASE_ID,
environment=RELEASEMODE
)
if __name__ == "__main__":
pass

28
src/config.py Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python3
import os
"""
Configuration variables
"""
__author__ = "@tormakris"
__copyright__ = "Copyright 2020, Birbnetes Team"
__module_name__ = "config"
__version__text__ = "1"
SENTRY_DSN = os.environ.get("SENTRY_DSN")
RELEASE_ID = os.environ.get("RELEASE_ID", "test")
RELEASEMODE = os.environ.get("GUARD_SERVICE_RELEASEMODE", "dev")
RABBIT_HOSTNAME = os.getenv("GUARD_RABBITMQ_HOSTNAME", "localhost")
RABBIT_USERNAME = os.getenv("GUARD_RABBITMQ_USERNAME", "guard-service")
RABBIT_PASSWORD = os.getenv("GUARD_RABBITMQ_PASSWORD", "guard-service")
RABBIT_EXCHANGE = os.getenv("GUARD_RABBITMQ_EXCHANGE", "guard-service")
MQTT_HOSTNAME = os.getenv("GUARD_MQTT_HOSTNAME", "localhost")
MQTT_USERNAME = os.getenv("GUARD_MQTT_USERNAME", "guard-service")
MQTT_PASSWORD = os.getenv("GUARD_MQTT_PASSWORD", "guard-service")
MQTT_EXCHANGE = os.getenv("GUARD_MQTT_EXCHANGE", "guard-service")