diff options
Diffstat (limited to 'ttun_server/types.py')
| -rw-r--r-- | ttun_server/types.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ttun_server/types.py b/ttun_server/types.py new file mode 100644 index 0000000..0b2fb87 --- /dev/null +++ b/ttun_server/types.py | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | from asyncio import Queue | ||
| 2 | from typing import TypedDict, Optional | ||
| 3 | |||
| 4 | |||
| 5 | class Config(TypedDict): | ||
| 6 | subdomain: str | ||
| 7 | |||
| 8 | class RequestData(TypedDict): | ||
| 9 | method: str | ||
| 10 | path: str | ||
| 11 | headers: dict | ||
| 12 | cookies: dict | ||
| 13 | body: Optional[str] | ||
| 14 | |||
| 15 | |||
| 16 | class ResponseData(TypedDict): | ||
| 17 | status: int | ||
| 18 | headers: dict | ||
| 19 | cookies: dict | ||
| 20 | body: Optional[str] | ||
| 21 | |||
| 22 | |||
| 23 | class Connection(TypedDict): | ||
| 24 | requests: Queue[RequestData] | ||
| 25 | responses: Queue[ResponseData] | ||
