feat(global): init structure
This commit is contained in:
3
src/dependencies/__init__.py
Normal file
3
src/dependencies/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from dishka import make_async_container
|
||||
|
||||
container = make_async_container()
|
||||
0
src/dependencies/getters/__init__.py
Normal file
0
src/dependencies/getters/__init__.py
Normal file
1
src/dependencies/integrations/__init__.py
Normal file
1
src/dependencies/integrations/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import asyncio
|
||||
16
src/dependencies/integrations/asyncio.py
Normal file
16
src/dependencies/integrations/asyncio.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Callable, ParamSpec, TypeVar
|
||||
|
||||
from dishka.integrations.base import wrap_injection
|
||||
|
||||
from dependencies import container
|
||||
|
||||
T = TypeVar("T")
|
||||
P = ParamSpec("P")
|
||||
|
||||
|
||||
def inject(func: Callable[P, T]) -> Callable[P, T]:
|
||||
return wrap_injection(
|
||||
func=func,
|
||||
is_async=True,
|
||||
container_getter=lambda args, kwargs: container,
|
||||
)
|
||||
0
src/dependencies/providers/__init__.py
Normal file
0
src/dependencies/providers/__init__.py
Normal file
0
src/dependencies/types/__init__.py
Normal file
0
src/dependencies/types/__init__.py
Normal file
Reference in New Issue
Block a user