-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
40 lines (25 loc) · 872 Bytes
/
config.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
from pydantic import BaseSettings
class TriggerPublisherConfig(BaseSettings):
CACHE_KEY: str = "service.control-tower"
class Config:
env_prefix = "PUBLISHER_"
class RedisCacheConfig(BaseSettings):
URL: str = "redis://127.0.0.1:6379"
class Config:
env_prefix = "REDIS_CACHE_"
class RedisPubSubConfig(BaseSettings):
URL: str = "redis://127.0.0.1:6389"
class Config:
env_prefix = "REDIS_PUBSUB_"
class ServerConfig(BaseSettings):
HOST: str = "127.0.0.1"
PORT: int = 8000
class Config:
env_prefix = "SERVER_"
class Config(BaseSettings):
publisher: TriggerPublisherConfig = TriggerPublisherConfig()
cache: RedisCacheConfig = RedisCacheConfig()
pubsub: RedisPubSubConfig = RedisPubSubConfig()
server: ServerConfig = ServerConfig()
class Config:
case_sensitive = True