-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: changed type files for adapters
- Loading branch information
Showing
6 changed files
with
33 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import netius as netius | ||
|
||
from typing import Any | ||
from netius.base.legacy import StringIO | ||
from typing import Any, BinaryIO, Sequence | ||
|
||
class BaseAdapter: | ||
def set(self, value: Any, owner: str = ...) -> None: ... | ||
def get(self, key: str) -> str | StringIO: ... | ||
def get_file(self, key: str, mode: str = ...) -> StringIO: ... | ||
def delete(self, key: str, owner: str = ...) -> None: ... | ||
def append(self, key:str , value: Any) -> None: ... | ||
def truncate(self, key:str , count: int) -> None: ... | ||
def size(self, key:str ) -> int: ... | ||
def set(self, value: Any, owner: str = ...): ... | ||
def get(self, key: str) -> bytes | None: ... | ||
def get_file(self, key: str, mode: str = ...) -> BinaryIO: ... | ||
def delete(self, key: str, owner: str = ...): ... | ||
def append(self, key: str, value: Any): ... | ||
def truncate(self, key: str, count: int): ... | ||
def size(self, key: str) -> int: ... | ||
def sizes(self, owner: str | None = ...) -> list[int]: ... | ||
def total(self, owner: str | None = ...) -> int: ... | ||
def reserve(self, owner: str = ...) -> None: ... | ||
def reserve(self, owner: str = ...): ... | ||
def count(self, owner: str | None = ...) -> int: ... | ||
def list(self, owner: str | None = ...) -> tuple[()]: ... | ||
def list(self, owner: str | None = ...) -> Sequence[str]: ... | ||
def generate(self) -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import netius as netius | ||
import netius.adapters.base | ||
import netius.adapters.base as base | ||
from os import PathLike | ||
|
||
from typing import Any, StrOrBytesPath | ||
from netius.base.legacy import StringIO | ||
from netius import BaseAdapter | ||
|
||
class FsAdapter(BaseAdapter): | ||
base_path: str | ||
|
||
class FsAdapter(netius.adapters.base.BaseAdapter): | ||
def __init__(self, base_path: str | None = ...) -> None: ... | ||
def set(self, value: Any, owner: str = ...) -> str: ... | ||
def get_file(self, key: str, mode: str = ...) -> StringIO: ... | ||
def delete(self, key: str, owner: str = ...) -> None: ... | ||
def size(self, key:str ) -> int: ... | ||
def count(self, owner: str | None = ...) -> int: ... | ||
def list(self, owner: str | None = ...) -> list[str]: ... | ||
def _path(self, owner: str | None = ...) -> str: ... | ||
def _ensure(self, owner: str) -> str: ... | ||
def _symlink(self, source: StrOrBytesPath, target: StrOrBytesPath) -> None: ... | ||
def _symlink(self, source: PathLike[str], target: PathLike[str]) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
import netius as netius | ||
import netius.adapters.base | ||
import netius.adapters.base as base | ||
from typing import Any, BinaryIO, Callable | ||
|
||
import typing | ||
from netius import BaseAdapter | ||
|
||
class MemoryAdapter(netius.adapters.base.BaseAdapter): | ||
def __init__(self) -> None: ... | ||
def set(self, value, owner: str = ...) -> str: ... | ||
def get_file(self, key: str, mode: str = ...) -> netius.legacy.StringIO: ... | ||
def delete(self, key: str, owner: str = ...) -> None: ... | ||
def append(self, key: str, value: typing.Any) -> None: ... | ||
def truncate(self, key: str, count: int) -> None: ... | ||
def size(self, key: str) -> int: ... | ||
def count(self, owner: str | None = ...) -> int: ... | ||
def list(self, owner: str | None = ...) -> tuple[()]: ... | ||
def _ensure(self, owner: str) -> dict: ... | ||
def _build_close(self, file: netius.legacy.StringIO, key: str) -> function: ... | ||
class MemoryAdapter(BaseAdapter): | ||
def __init__(self): ... | ||
def _ensure(self, owner: str) -> dict[str, Any]: ... | ||
def _build_close(self, file: BinaryIO, key: str) -> Callable[[], None]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import netius.adapters.base | ||
import netius.adapters.base as base | ||
from netius import BaseAdapter | ||
|
||
class MongoAdapter(netius.adapters.base.BaseAdapter): | ||
def set(self, value: str, owner: str = ...): ... | ||
def get(self, key: str): ... | ||
class MongoAdapter(BaseAdapter): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import netius.adapters.base | ||
import netius.adapters.base as base | ||
from netius import BaseAdapter | ||
|
||
class NullAdapter(netius.adapters.base.BaseAdapter): ... | ||
class NullAdapter(BaseAdapter): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
from typing import Literal | ||
|
||
HashType = Literal["plain", "md5", "sha1", "sha256", "sha512"] | ||
HashType = Literal["plain", "md5", "sha1", "sha256", "sha512"] | ||
|
||
class Auth(object): | ||
class Auth(object): | ||
@classmethod | ||
def verify(cls, encoded: str, decoded: str) -> bool: ... | ||
|
||
@classmethod | ||
def generate(cls, password: str, type: HashType = "sha256", salt: str = "netius") -> str: ... | ||
|
||
def generate( | ||
cls, password: str, type: HashType = "sha256", salt: str = "netius" | ||
) -> str: ... | ||
@classmethod | ||
def unpack(cls, password: str) -> tuple[HashType, str, str, str]: ... |