API
Reference
QuartModule
- class quart_injector.QuartModule(app)
Bases:
Module
Quart module.
- Parameters:
app (Quart) – quart application
- configure(binder)
Override to configure bindings.
- Parameters:
binder (Binder) –
- Return type:
None
request
- quart_injector.request(cls: injector.T) injector.T = ScopeDecorator(RequestScope)
A decorator for
quart_injector.RequestScope
.- Parameters:
cls (T) –
- Return type:
T
RequestScope
- class quart_injector.RequestScope(injector)
Bases:
Scope
Request scope
A
Scope
that returns a per-request instance for a key.- Parameters:
injector (Injector) –
wire
- quart_injector.wire(app, modules=None, auto_bind=True, parent=None)
Wire.
Wire up a dependency injection container to the given application.
- Parameters:
app (Quart) – quart application
modules (Callable[[Binder], None] | Module | Type[Module] | Iterable[Callable[[Binder], None] | Module | Type[Module]] | None) – configuration module or iterable of configuration modules
auto_bind (bool) – whether to automatically bind missing types
parent (Injector | None) – dependency injection container
- Return type:
None