This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
71 lines (52 loc) · 1.84 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import pydantic
class ServiceSettings(pydantic.BaseSettings):
"""Settings which are related to the general service execution"""
name: str = pydantic.Field(
default="water-usage-forecasts-calculations",
alias="CONFIG_SERVICE_NAME",
env="CONFIG_SERVICE_NAME",
)
"""
Microservice Name
The name of the service which is used for registering at the service registry
"""
logging_level: str = pydantic.Field(
default="INFO", alias="CONFIG_LOGGING_LEVEL", env="CONFIG_LOGGING_LEVEL"
)
"""
Logging Level
The logging level which will be visible on the stdout
"""
class Config:
env_file = ".env"
class AMQPSettings(pydantic.BaseSettings):
"""Settings which are related to the communication with our message broker"""
dsn: pydantic.AmqpDsn = pydantic.Field(
default=..., alias="CONFIG_AMQP_DSN", env="CONFIG_AMQP_DSN"
)
"""
Advanced Message Queueing Protocol data source name
The data source name (expressed as URI) pointing to a AMQPv-0-9-1 compatible message broker
"""
bind_exchange: str = pydantic.Field(
default="water-usage-forecasts",
alias="CONFIG_AMQP_BIND_EXCHANGE",
env="CONFIG_AMQP_BIND_EXCHANGE",
)
"""
Incoming Message Broker Exchange
The exchange that this service will bind itself to, for receiving messages
"""
class Config:
env_file = ".env"
class DatabaseSettings(pydantic.BaseSettings):
"""Settings which are related to the database connection"""
dsn: pydantic.PostgresDsn = pydantic.Field(
default=..., alias="CONFIG_DB_DSN", env="CONFIG_DB_DSN"
)
"""
PostgreSQL data source name
The data source name (expressed as URI) pointing to the installation of the used postgresql database
"""
class Config:
env_file = ".env"