Coverage for src/zapy/api/models.py: 100%

56 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-02-10 19:35 +0000

1import asyncio 

2import os 

3import typing 

4 

5from pydantic import BaseModel 

6from typing_extensions import TypedDict 

7from uvicorn.config import ( 

8 HTTPProtocolType, 

9 InterfaceType, 

10 LifespanType, 

11 LoopSetupType, 

12 WSProtocolType, 

13) 

14 

15 

16class ServerConnection(BaseModel): 

17 host: str 

18 port: int 

19 

20 

21# Copied from uvicorn 

22 

23 

24class UvicornRunConfig(TypedDict, total=False): 

25 host: str 

26 port: int 

27 uds: str 

28 fd: int 

29 loop: LoopSetupType 

30 http: typing.Union[typing.Type[asyncio.Protocol], HTTPProtocolType] 

31 ws: typing.Union[typing.Type[asyncio.Protocol], WSProtocolType] 

32 ws_max_size: int 

33 ws_max_queue: int 

34 ws_ping_interval: float 

35 ws_ping_timeout: float 

36 ws_per_message_deflate: bool 

37 lifespan: LifespanType 

38 interface: InterfaceType 

39 reload: bool 

40 reload_dirs: typing.Union[typing.List[str], str] 

41 reload_includes: typing.Union[typing.List[str], str] 

42 reload_excludes: typing.Union[typing.List[str], str] 

43 reload_delay: float 

44 workers: int 

45 env_file: typing.Union[str, os.PathLike] 

46 log_config: typing.Union[typing.Dict[str, typing.Any], str] 

47 log_level: typing.Union[str, int] 

48 access_log: bool 

49 proxy_headers: bool 

50 server_header: bool 

51 date_header: bool 

52 forwarded_allow_ips: typing.Union[typing.List[str], str] 

53 root_path: str 

54 limit_concurrency: int 

55 backlog: int 

56 limit_max_requests: int 

57 timeout_keep_alive: int 

58 timeout_graceful_shutdown: int 

59 ssl_keyfile: str 

60 ssl_certfile: typing.Union[str, os.PathLike] 

61 ssl_keyfile_password: str 

62 ssl_version: int 

63 ssl_cert_reqs: int 

64 ssl_ca_certs: str 

65 ssl_ciphers: str 

66 headers: typing.List[typing.Tuple[str, str]] 

67 use_colors: bool 

68 app_dir: str 

69 factory: bool 

70 h11_max_incomplete_event_size: int