Skip to content

Commit d1d9d9e

Browse files
authored
Add static protocol object for type checking
1 parent de13727 commit d1d9d9e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

httptools/parser/protocol.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from typing import Protocol
2+
3+
class HTTPProtocol(Protocol):
4+
"""Used for providing static type-checking when parsing through the http protocol"""
5+
6+
def on_message_begin() -> None:...
7+
def on_url(url: bytes) -> None:...
8+
def on_header(name: bytes, value: bytes) -> None:...
9+
def on_headers_complete() -> None:...
10+
def on_body(body: bytes) -> None:...
11+
def on_message_complete() -> None:...
12+
def on_chunk_header() -> None:...
13+
def on_chunk_complete() -> None:...
14+
def on_status(status: bytes) -> None:...
15+

0 commit comments

Comments
 (0)