Skip to content

Commit 7017f7d

Browse files
committed
applied ellar package dependence refactor
1 parent 2c9d994 commit 7017f7d

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ The global guard check can be skipped using the `@skip_throttle()` decorator men
7070
Example with `@guards(ThrottlerGuard)`
7171
```python
7272
# project_name/controller.py
73-
from ellar.common import Controller, guards
74-
from ellar_throttler import throttle, ThrottlerGuard, skip_throttle
73+
from ellar.common import Controller, Guards
74+
from ellar_throttler import throttle, ThrottlerGuard
7575

7676
@Controller()
7777
class AppController:
7878

79-
@guards(ThrottlerGuard)
79+
@Guards(ThrottlerGuard)
8080
@throttle(limit=5, ttl=30)
8181
def normal(self):
8282
pass
@@ -178,7 +178,7 @@ To work with Websockets you can extend the `ThrottlerGuard` and override the `ha
178178
```python
179179
from ellar_throttler import ThrottlerGuard
180180
from ellar.di import injectable
181-
from ellar.core import IExecutionContext
181+
from ellar.common import IExecutionContext
182182
from ellar_throttler import ThrottledException
183183

184184
@injectable()

ellar_throttler/exception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import math
22
import typing as t
33

4-
from ellar.core.exceptions import APIException
4+
from ellar.common import APIException
55
from starlette import status
66

77

ellar_throttler/module.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import typing as t
22

3-
from ellar.common import Module
4-
from ellar.core import IExecutionContext
5-
from ellar.core.modules import DynamicModule, IModuleSetup, ModuleBase
3+
from ellar.common import IExecutionContext, IModuleSetup, Module
4+
from ellar.core.modules import DynamicModule, ModuleBase
65
from ellar.di import ProviderConfig
76

87
from ellar_throttler.interfaces import IThrottlerStorage

ellar_throttler/throttler_guard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import hashlib
22
import typing as t
33

4-
from ellar.core import GuardCanActivate, IExecutionContext, Response
4+
from ellar.common import GuardCanActivate, IExecutionContext, Response
5+
from ellar.common.helper import get_name
56
from ellar.core.connection import HTTPConnection
67
from ellar.core.services import Reflector
78
from ellar.di import injectable
8-
from ellar.helper import get_name
99

1010
from .constants import THROTTLER_LIMIT, THROTTLER_SKIP, THROTTLER_TTL
1111
from .exception import ThrottledException

ellar_throttler/throttler_module_options.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import typing as t
22

3-
from ellar.core import IExecutionContext
4-
from ellar.core.serializer import Serializer
3+
from ellar.common import IExecutionContext, Serializer
54

65

76
class ThrottlerModuleOptions(Serializer):

ellar_throttler/throttler_storage_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ellar.core.serializer import Serializer
1+
from ellar.common import Serializer
22

33

44
class ThrottlerStorageOption(Serializer):

ellar_throttler/throttler_storage_record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ellar.core.serializer import Serializer
1+
from ellar.common import Serializer
22

33

44
class ThrottlerStorageRecord(Serializer):

0 commit comments

Comments
 (0)