Module spangle.handler_protocols¶
Protocols of request/error handler.
Classes¶
BaseHandlerProtocol¶
class BaseHandlerProtocol(self)
Every handler class should initialize without args.
Base classes¶
typing.Protocol
DeleteHandlerProtocol¶
class DeleteHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_delete(self, req: Request, resp: Response, /) -> Optional[Response]
GetHandlerProtocol¶
class GetHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_get(self, req: Request, resp: Response, /) -> Optional[Response]
HttpErrorHandlerProtocol¶
class HttpErrorHandlerProtocol(*args, **kwargs)
Error handler must implement on_error
.
Base classes¶
Methods¶
async def on_error(
self, req: Request, resp: Response, e: E, /
) -> Optional[Response]
PatchHandlerProtocol¶
class PatchHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_patch(self, req: Request, resp: Response, /) -> Optional[Response]
PostHandlerProtocol¶
class PostHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_post(self, req: Request, resp: Response, /) -> Optional[Response]
PutHandlerProtocol¶
class PutHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_put(self, req: Request, resp: Response, /) -> Optional[Response]
RequestHandlerProtocol¶
class RequestHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_request(self, req: Request, resp: Response, /) -> Optional[Response]
WebSocketErrorHandlerProtocol¶
class WebSocketErrorHandlerProtocol(*args, **kwargs)
Error handler must implement on_ws_error
.
Base classes¶
Methods¶
async def on_ws_error(self, conn: Connection, e: E, /) -> None
WebsocketHandlerProtocol¶
class WebsocketHandlerProtocol(*args, **kwargs)
Every handler class should initialize without args.
Base classes¶
Methods¶
async def on_ws(self, conn: Connection, /) -> None
Functions¶
use_params¶
def use_params() -> dict
Return parsed parameters typed by types
.