[feat] add config yaml and env
This commit is contained in:
parent
39f28d8f30
commit
1588efb9ca
6 changed files with 328 additions and 0 deletions
42
adapter/config/model.py
Normal file
42
adapter/config/model.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class AppSectionConfig:
|
||||
name: str
|
||||
env: str
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class HttpConfig:
|
||||
host: str
|
||||
port: int
|
||||
api_prefix: str
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class LoggingConfig:
|
||||
level: str
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class OtelConfig:
|
||||
service_name: str
|
||||
exporter_endpoint: str
|
||||
metric_export_interval: int
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class SecurityConfig:
|
||||
token_header: str
|
||||
api_token: str
|
||||
signing_key: str
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class AppConfig:
|
||||
app: AppSectionConfig
|
||||
http: HttpConfig
|
||||
logging: LoggingConfig
|
||||
otel: OtelConfig
|
||||
security: SecurityConfig
|
||||
Loading…
Add table
Add a link
Reference in a new issue