-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b76b62e
commit 8293a4c
Showing
14 changed files
with
2,324 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
build: | ||
maturin build | ||
|
||
install: | ||
maturin build | ||
pip install . | ||
|
||
test: | ||
python -m pytest | ||
|
||
fmt: | ||
cargo fmt | ||
|
||
lint: | ||
cargo clippy |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
""" | ||
Type hints for Native Rust Extension | ||
""" | ||
|
||
from typing import Any, Final, Optional | ||
|
||
class Client: | ||
""" """ | ||
|
||
def __init__(self, endpoints: list[str]) -> None: | ||
""" """ | ||
def connect(self) -> "Client": | ||
""" """ | ||
def __aenter__(self) -> "Communicator": | ||
""" """ | ||
|
||
class Watch: | ||
""" """ | ||
|
||
class Communicator: | ||
def get(self, key: str) -> str: | ||
""" """ | ||
def get_prefix(self, key: str) -> dict: | ||
""" """ | ||
def keys_prefix(self, key: str) -> list[str]: | ||
""" """ | ||
def delete(self, key: str) -> None: | ||
""" """ | ||
def delete_prefix(self, key: str) -> None: | ||
""" """ | ||
def put(self, key: str, value: str) -> None: | ||
""" """ | ||
def watch(self, key: str) -> "Watch": | ||
""" """ | ||
def watch_prefix(self, key: str) -> "Watch": | ||
""" """ | ||
|
||
class Event: | ||
""" """ | ||
|
||
def __init__( | ||
key: str, value: str, event: "EventType", prev_value: Optional[str] | ||
) -> None: ... | ||
|
||
class EventType: | ||
""" """ | ||
|
||
PUT: Final[Any] | ||
""" | ||
""" | ||
DELETE: Final[Any] | ||
""" | ||
""" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from etcd_client import Client | ||
|
||
etcd = Client(["http://localhost:2379"]) |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
python_files = */tests/*.py |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
maturin==1.3.2 | ||
pytest==7.3.1 |
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
Binary file not shown.
Binary file not shown.
Oops, something went wrong.