faust.types.web

class faust.types.web.Request[source]
class faust.types.web.Response[source]
class faust.types.web.ResourceOptions(allow_credentials: bool = False, expose_headers: Optional[Union[str, Sequence[str]]] = (), allow_headers: Optional[Union[str, Sequence[str]]] = (), max_age: Optional[int] = None, allow_methods: Optional[Union[str, Sequence[str]]] = ())[source]

CORS Options for specific route, or defaults.

allow_credentials: bool

Alias for field number 0

expose_headers: Optional[Union[str, Sequence[str]]]

Alias for field number 1

allow_headers: Optional[Union[str, Sequence[str]]]

Alias for field number 2

max_age: Optional[int]

Alias for field number 3

allow_methods: Optional[Union[str, Sequence[str]]]

Alias for field number 4

class faust.types.web.View[source]
faust.types.web.HttpClientT

alias of ClientSession

class faust.types.web.Web[source]
class faust.types.web.CacheBackendT(app: _AppT, url: Union[URL, str] = 'memory://', **kwargs: Any)[source]
Unavailable: Type[BaseException]
abstract async get(key: str) Optional[bytes][source]
Return type:

_UnionGenericAlias[bytes, None]

abstract async set(key: str, value: bytes, timeout: Optional[float] = None) None[source]
Return type:

None

abstract async delete(key: str) None[source]
Return type:

None

class faust.types.web.CacheT(timeout: Optional[Union[timedelta, float, str]] = None, key_prefix: Optional[str] = None, backend: Optional[Union[Type[CacheBackendT], str]] = None, **kwargs: Any)[source]
timeout: Optional[Union[timedelta, float, str]]
include_headers: bool
key_prefix: str
backend: Optional[Union[Type[CacheBackendT], str]]
abstract view(timeout: Optional[Union[timedelta, float, str]] = None, include_headers: bool = False, key_prefix: Optional[str] = None, **kwargs: Any) Callable[[Callable], Callable][source]
Return type:

_CallableGenericAlias[_CallableType, _CallableType]

class faust.types.web.BlueprintT[source]
name: str
url_prefix: Optional[str]
abstract cache(timeout: Optional[Union[timedelta, float, str]] = None, include_headers: bool = False, key_prefix: Optional[str] = None, backend: Optional[Union[Type[CacheBackendT], str]] = None) CacheT[source]
Return type:

CacheT

abstract route(uri: str, *, name: ~typing.Optional[str] = None, base: ~typing.Type[~faust.types.web.View] = <class 'faust.types.web.View'>) Callable[[Union[Type[View], Callable[[View, Request], Union[Coroutine[Any, Any, Response], Awaitable[Response]]], Callable[[View, Request, Any, Any], Union[Coroutine[Any, Any, Response], Awaitable[Response]]]]], Union[Type[View], Callable[[View, Request], Union[Coroutine[Any, Any, Response], Awaitable[Response]]], Callable[[View, Request, Any, Any], Union[Coroutine[Any, Any, Response], Awaitable[Response]]]]][source]
Return type:

_CallableGenericAlias[_UnionGenericAlias[_GenericAlias[View], _CallableGenericAlias[View, Request, _UnionGenericAlias[_GenericAlias[Any, Any, Response], _GenericAlias[Response]]], _CallableGenericAlias[View, Request, Any, Any, _UnionGenericAlias[_GenericAlias[Any, Any, Response], _GenericAlias[Response]]]], _UnionGenericAlias[_GenericAlias[View], _CallableGenericAlias[View, Request, _UnionGenericAlias[_GenericAlias[Any, Any, Response], _GenericAlias[Response]]], _CallableGenericAlias[View, Request, Any, Any, _UnionGenericAlias[_GenericAlias[Any, Any, Response], _GenericAlias[Response]]]]]

abstract static(uri: str, file_or_directory: Union[str, Path], *, name: Optional[str] = None) None[source]
Return type:

None

abstract register(app: _AppT, *, url_prefix: Optional[str] = None) None[source]

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

Return type:

None

abstract init_webserver(web: Web) None[source]
Return type:

None

abstract on_webserver_init(web: Web) None[source]
Return type:

None