Implement sending messages
This commit is contained in:
@@ -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",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user