Implement sending messages

This commit is contained in:
2025-04-21 01:58:33 +02:00
parent 3d631e74cd
commit b8f51d7235
6 changed files with 180 additions and 12 deletions

View File

@@ -4,10 +4,24 @@ from pydantic import BaseModel
from fastapi import Depends
class _ComponentConfig(BaseModel):
# The JID of the component
jid: str
# Address of server's component port
server: str
# The component's secret.
secret: str
class _Config(BaseModel):
# DB URI for sqlmodel
database: str
# Component configuration
component: _ComponentConfig
def load_config() -> _Config:
"""
@@ -16,6 +30,11 @@ def load_config() -> _Config:
# TODO: Actually load it
return _Config(
database="sqlite:///db.sqlite3",
component=_ComponentConfig(
jid="test.localhost",
server="localhost:5869",
secret="abc123",
),
)