updated Postgres Service
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Configs(BaseSettings):
|
||||
"""
|
||||
MongoDB configuration settings.
|
||||
"""
|
||||
HOST: str = ""
|
||||
PASSWORD: str = ""
|
||||
PORT: int = 0
|
||||
DB: int = 0
|
||||
|
||||
def as_dict(self):
|
||||
return dict(
|
||||
host=self.HOST,
|
||||
password=self.PASSWORD,
|
||||
port=int(self.PORT),
|
||||
db=self.DB,
|
||||
)
|
||||
|
||||
model_config = SettingsConfigDict(env_prefix="REDIS_")
|
||||
|
||||
|
||||
redis_configs = Configs() # singleton instance of the REDIS configuration settings
|
||||
print(redis_configs.as_dict())
|
||||
|
||||
Reference in New Issue
Block a user