Skip to content

Module tipg.middleware

tipg middlewares.

Classes

CacheControlMiddleware

class CacheControlMiddleware(
    app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[NoneType]]], Awaitable[NoneType]],
    cachecontrol: Union[str, NoneType] = None,
    cachecontrol_max_http_code: Union[int, NoneType] = 500,
    exclude_path: Union[Set[str], NoneType] = None
)

MiddleWare to add CacheControl in response headers.

CatalogUpdateFunc

class CatalogUpdateFunc(
    *args,
    **kwargs
)

Catalog update function protocol.

Ancestors (in MRO)

  • typing.Protocol
  • typing.Generic

CatalogUpdateMiddleware

class CatalogUpdateMiddleware(
    app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[NoneType]]], Awaitable[NoneType]],
    *,
    func: tipg.middleware.CatalogUpdateFunc,
    ttl: int = 300,
    **kwargs: Any
)

Middleware to update the catalog cache.