-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement wedpr-python-gateway-sdk (#48)
* implement wedpr-python-gateway-sdk * add generated cxx file
- Loading branch information
1 parent
aa82d55
commit acb9355
Showing
30 changed files
with
25,898 additions
and
36 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
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
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 @@ | ||
__version__ = "1.0.0" |
Empty file.
19 changes: 19 additions & 0 deletions
19
cpp/wedpr-transport/sdk-wrapper/python/bindings/libs/_wedpr_python_transport.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,19 @@ | ||
# -*- coding: utf-8 -*- | ||
import shutil | ||
import pkg_resources | ||
from utils.lib_loader import LibLoader | ||
|
||
|
||
def __bootstrap__(): | ||
global __bootstrap__, __loader__, __file__ | ||
import sys | ||
import pkg_resources | ||
import imp | ||
__file__ = pkg_resources.resource_filename( | ||
__name__, LibLoader.get_lib_name()) | ||
__loader__ = None | ||
del __bootstrap__, __loader__ | ||
imp.load_dynamic(__name__, __file__) | ||
|
||
|
||
__bootstrap__() |
Empty file.
84 changes: 84 additions & 0 deletions
84
cpp/wedpr-transport/sdk-wrapper/python/bindings/transport/api/message_api.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,84 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from abc import ABC, abstractmethod | ||
|
||
|
||
class MessageHeaderAPI(ABC): | ||
@abstractmethod | ||
def get_version(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_trace_id(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_src_gw_node(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_dst_gw_node(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_packet_type(self) -> int: | ||
pass | ||
|
||
@abstractmethod | ||
def get_ttl(self) -> int: | ||
pass | ||
|
||
@abstractmethod | ||
def get_ext(self) -> int: | ||
pass | ||
|
||
@abstractmethod | ||
def is_resp_packet(self) -> bool: | ||
pass | ||
|
||
@abstractmethod | ||
def get_route_type(self) -> int: | ||
pass | ||
|
||
@abstractmethod | ||
def get_component_type(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_src_node(self) -> bytes: | ||
pass | ||
|
||
@abstractmethod | ||
def get_dst_node(self) -> bytes: | ||
pass | ||
|
||
@abstractmethod | ||
def get_dst_inst(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_src_inst(self) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_topic(self) -> str: | ||
pass | ||
|
||
|
||
class MessageAPI(ABC): | ||
|
||
@abstractmethod | ||
def get_header(self) -> MessageHeaderAPI: | ||
pass | ||
|
||
@abstractmethod | ||
def get_seq(self) -> int: | ||
pass | ||
|
||
@abstractmethod | ||
def get_payload(self) -> bytes: | ||
pass | ||
|
||
@abstractmethod | ||
def get_length(self) -> int: | ||
pass |
50 changes: 50 additions & 0 deletions
50
cpp/wedpr-transport/sdk-wrapper/python/bindings/transport/api/transport_api.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,50 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from abc import ABC, abstractmethod | ||
from transport.api.message_api import MessageAPI | ||
|
||
|
||
class TransportAPI(ABC): | ||
@abstractmethod | ||
def start(self): | ||
pass | ||
|
||
@abstractmethod | ||
def stop(self): | ||
pass | ||
|
||
@abstractmethod | ||
def push_by_nodeid(topic: str, dstNode: bytes, seq: int, payload: bytes, timeout: int): | ||
pass | ||
|
||
@abstractmethod | ||
def push_by_inst(topic: str, dstInst: str, seq: int, payload: bytes, timeout: int): | ||
pass | ||
|
||
@abstractmethod | ||
def push_by_component(topic: str, dstInst: str, component: str, seq: int, payload: bytes, timeout: int): | ||
pass | ||
|
||
@abstractmethod | ||
def pop(self, topic, timeoutMs) -> MessageAPI: | ||
pass | ||
|
||
@abstractmethod | ||
def peek(self, topic) -> MessageAPI: | ||
pass | ||
|
||
@abstractmethod | ||
def register_topic(self, topic): | ||
pass | ||
|
||
@abstractmethod | ||
def unregister_topic(self, topic): | ||
pass | ||
|
||
@abstractmethod | ||
def register_component(self, component): | ||
pass | ||
|
||
@abstractmethod | ||
def unregister_component(self, component): | ||
pass |
Empty file.
Oops, something went wrong.