-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved all interfaces and typing files
Co-authored-by: mystical-prog <[email protected]>
- Loading branch information
1 parent
2713f3d
commit 866dec9
Showing
16 changed files
with
125 additions
and
159 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
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
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,15 +1,49 @@ | ||
from collections.abc import ( | ||
Awaitable, | ||
Mapping, | ||
) | ||
from typing import ( | ||
TYPE_CHECKING, | ||
Callable, | ||
NewType, | ||
Union, | ||
) | ||
|
||
if TYPE_CHECKING: | ||
from libp2p.abc import IMuxedStream # noqa: F401 | ||
from libp2p.abc import INetStream # noqa: F401 | ||
from libp2p.abc import ( | ||
IMuxedConn, | ||
INetStream, | ||
ISecureTransport, | ||
) | ||
else: | ||
|
||
class INetStream: | ||
pass | ||
|
||
class IMuxedConn: | ||
pass | ||
|
||
class ISecureTransport: | ||
pass | ||
|
||
|
||
from libp2p.io.abc import ( | ||
ReadWriteCloser, | ||
) | ||
from libp2p.peer.id import ( | ||
ID, | ||
) | ||
from libp2p.pubsub.pb import ( | ||
rpc_pb2, | ||
) | ||
|
||
TProtocol = NewType("TProtocol", str) | ||
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]] | ||
THandler = Callable[[ReadWriteCloser], Awaitable[None]] | ||
TSecurityOptions = Mapping[TProtocol, "ISecureTransport"] | ||
TMuxerClass = type["IMuxedConn"] | ||
TMuxerOptions = Mapping[TProtocol, TMuxerClass] | ||
SyncValidatorFn = Callable[[ID, rpc_pb2.Message], bool] | ||
AsyncValidatorFn = Callable[[ID, rpc_pb2.Message], Awaitable[bool]] | ||
ValidatorFn = Union[SyncValidatorFn, AsyncValidatorFn] | ||
UnsubscribeFn = Callable[[], Awaitable[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
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
Oops, something went wrong.