Skip to content

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

on_delete

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

on_get

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

on_error

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

on_patch

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

on_post

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

on_put

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

on_request

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

on_ws_error

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

on_ws

async def on_ws(self, conn: Connection, /) -> None

Functions

use_params

def use_params() -> dict

Return parsed parameters typed by types .