# DaaS
[![Build Status](https://travis-ci.org/ducesoft/babel.svg?branch=master)](https://travis-ci.org/ducesoft/babel)
[![Financial Contributors on Open Collective](https://opencollective.com/babel/all/badge.svg?label=financial+contributors)](https://opencollective.com/babel) [![codecov](https://codecov.io/gh/babel/babel/branch/master/graph/badge.svg)](https://codecov.io/gh/babel/babel)
![license](https://img.shields.io/github/license/ducesoft/babel.svg)
中文版 [README](README_CN.md)
## Introduction
Mesh is a standard implementation for [Private Transmission Protocol](Specifications.md) specification.
Mesh Python develop kits base on Python3.6. Recommend use [poetry](https://github.com/python-poetry/poetry) to manage
dependencies.
## Features
As an open source Internet of Data infrastructure develop kits, Mesh has the following core functions:
* Minimal kernel with SPI plugin architecture, everything is replacement.
* Support full stack of service mesh architecture.
* Support full stack of service oriented architecture.
* Support transport with TCP, HTTP, or other RPC protocols.
* Support rich routing features.
* Support reliable upstream management and load balancing capabilities.
* Support network and protocol layer observability.
* Support mTLS and protocols on TLS.
* Support rich extension mechanism to provide highly customizable expansion capabilities.
* Support process smooth upgrade.
## Get Started
```bash
poetry add imesh
```
or
```bash
pip install imesh
```
### RPC
Declared rpc interface Facade.
```python
from abc import ABC, abstractmethod
from mesh import spi, mpi
@spi("mesh")
class Tokenizer(ABC):
@abstractmethod
@mpi("mesh.trust.apply")
def apply(self, kind: str, duration: int) -> str:
"""
Apply a node token.
:param kind:
:param duration:
:return:
"""
pass
@abstractmethod
@mpi("mesh.trust.verify")
def verify(self, token: str) -> bool:
"""
Verify some token verifiable.
:param token:
:return:
"""
pass
```
Declared rpc service Implement.
```python
from mesh import mps, Tokenizer
@mps
class MeshTokenizer(Tokenizer):
def apply(self, kind: str, duration: int) -> str:
return "foo"
def verify(self, token: str) -> bool:
return True
```
Remote reference procedure call.
```python
from mesh import mpi, Tokenizer
class Component:
@mpi
def tokenizer(self) -> Tokenizer:
pass
def invoke(self) -> bool:
token = self.tokenizer().apply('PERMIT', 1000 * 60 * 5)
return self.tokenizer().verify(token)
```
### Transport
Transport is a full duplex communication stream implement.
```python
import mesh
from mesh import Mesh, log, ServiceLoader, Transport, Routable
from mesh.prsim import Metadata
def main():
mesh.start()
transport = Routable.of(ServiceLoader.load(Transport).get("mesh"))
session = transport.with_address("10.99.1.33:570").local().open('session_id_008', {
Metadata.MESH_VERSION.key(): '',
Metadata.MESH_TECH_PROVIDER_CODE.key(): 'LX',
Metadata.MESH_TRACE_ID.key(): Mesh.context().get_trace_id(),
Metadata.MESH_TOKEN.key(): 'x',
Metadata.MESH_SESSION_ID.key(): 'session_id_008',
Metadata.MESH_TARGET_INST_ID.key(): 'JG0100000100000000',
})
for index in range(100):
inbound = f"节点4发送给节点5报文{index}"
log.info(f"节点4发送:{inbound}")
session.push(inbound.encode('utf-8'), {}, "topic")
outbound = session.pop(10000, "topic")
if outbound:
log.info(f"节点4接收:{outbound.decode('utf-8')}")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/jiumi/meio",
"name": "daas",
"maintainer": "coyzeng",
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": "coyzeng@gmail.com",
"keywords": "servicemesh, rpc, codec, cluster, registry",
"author": "coyzeng",
"author_email": "coyzeng@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8c/c6/66abdbcb6afa510d983cdb86ae513ef00e0379ccf7dcbadfae1ac8455671/daas-0.0.13.tar.gz",
"platform": null,
"description": "# DaaS\n\n[![Build Status](https://travis-ci.org/ducesoft/babel.svg?branch=master)](https://travis-ci.org/ducesoft/babel)\n[![Financial Contributors on Open Collective](https://opencollective.com/babel/all/badge.svg?label=financial+contributors)](https://opencollective.com/babel) [![codecov](https://codecov.io/gh/babel/babel/branch/master/graph/badge.svg)](https://codecov.io/gh/babel/babel)\n![license](https://img.shields.io/github/license/ducesoft/babel.svg)\n\n\u4e2d\u6587\u7248 [README](README_CN.md)\n\n## Introduction\n\nMesh is a standard implementation for [Private Transmission Protocol](Specifications.md) specification.\n\nMesh Python develop kits base on Python3.6. Recommend use [poetry](https://github.com/python-poetry/poetry) to manage\ndependencies.\n\n## Features\n\nAs an open source Internet of Data infrastructure develop kits, Mesh has the following core functions:\n\n* Minimal kernel with SPI plugin architecture, everything is replacement.\n* Support full stack of service mesh architecture.\n* Support full stack of service oriented architecture.\n* Support transport with TCP, HTTP, or other RPC protocols.\n* Support rich routing features.\n* Support reliable upstream management and load balancing capabilities.\n* Support network and protocol layer observability.\n* Support mTLS and protocols on TLS.\n* Support rich extension mechanism to provide highly customizable expansion capabilities.\n* Support process smooth upgrade.\n\n## Get Started\n\n```bash\npoetry add imesh\n```\n\nor\n\n```bash\npip install imesh\n```\n\n### RPC\n\nDeclared rpc interface Facade.\n\n```python\n\nfrom abc import ABC, abstractmethod\n\nfrom mesh import spi, mpi\n\n\n@spi(\"mesh\")\nclass Tokenizer(ABC):\n\n @abstractmethod\n @mpi(\"mesh.trust.apply\")\n def apply(self, kind: str, duration: int) -> str:\n \"\"\"\n Apply a node token.\n :param kind:\n :param duration:\n :return:\n \"\"\"\n pass\n\n @abstractmethod\n @mpi(\"mesh.trust.verify\")\n def verify(self, token: str) -> bool:\n \"\"\"\n Verify some token verifiable.\n :param token:\n :return:\n \"\"\"\n pass\n```\n\nDeclared rpc service Implement.\n\n```python\n\nfrom mesh import mps, Tokenizer\n\n\n@mps\nclass MeshTokenizer(Tokenizer):\n\n def apply(self, kind: str, duration: int) -> str:\n return \"foo\"\n\n def verify(self, token: str) -> bool:\n return True\n```\n\nRemote reference procedure call.\n\n```python\n\nfrom mesh import mpi, Tokenizer\n\n\nclass Component:\n\n @mpi\n def tokenizer(self) -> Tokenizer:\n pass\n\n def invoke(self) -> bool:\n token = self.tokenizer().apply('PERMIT', 1000 * 60 * 5)\n return self.tokenizer().verify(token)\n\n\n```\n\n### Transport\n\nTransport is a full duplex communication stream implement.\n\n```python\nimport mesh\nfrom mesh import Mesh, log, ServiceLoader, Transport, Routable\nfrom mesh.prsim import Metadata\n\n\ndef main():\n mesh.start()\n\n transport = Routable.of(ServiceLoader.load(Transport).get(\"mesh\"))\n session = transport.with_address(\"10.99.1.33:570\").local().open('session_id_008', {\n Metadata.MESH_VERSION.key(): '',\n Metadata.MESH_TECH_PROVIDER_CODE.key(): 'LX',\n Metadata.MESH_TRACE_ID.key(): Mesh.context().get_trace_id(),\n Metadata.MESH_TOKEN.key(): 'x',\n Metadata.MESH_SESSION_ID.key(): 'session_id_008',\n Metadata.MESH_TARGET_INST_ID.key(): 'JG0100000100000000',\n })\n for index in range(100):\n inbound = f\"\u8282\u70b94\u53d1\u9001\u7ed9\u8282\u70b95\u62a5\u6587{index}\"\n log.info(f\"\u8282\u70b94\u53d1\u9001:{inbound}\")\n session.push(inbound.encode('utf-8'), {}, \"topic\")\n outbound = session.pop(10000, \"topic\")\n if outbound:\n log.info(f\"\u8282\u70b94\u63a5\u6536:{outbound.decode('utf-8')}\")\n\n```\n",
"bugtrack_url": null,
"license": "LICENSE",
"summary": "A lightweight, distributed, relational network architecture for MPC.",
"version": "0.0.13",
"project_urls": {
"Documentation": "https://github.com/jiumi/meio",
"Homepage": "https://github.com/jiumi/meio",
"Repository": "https://github.com/jiumi/meio"
},
"split_keywords": [
"servicemesh",
" rpc",
" codec",
" cluster",
" registry"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ad6ae3da701783788dec53ef94f2b3aacd53a0dbf8ff1955c51634e96feb3326",
"md5": "eac60b1c4c2127e38fbd0a9fe65d42e7",
"sha256": "d6986dd7da961c504b9b83393790658cd94d04340ab70bad67f2b5899ee905c8"
},
"downloads": -1,
"filename": "daas-0.0.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eac60b1c4c2127e38fbd0a9fe65d42e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 181143,
"upload_time": "2024-06-15T11:16:12",
"upload_time_iso_8601": "2024-06-15T11:16:12.728000Z",
"url": "https://files.pythonhosted.org/packages/ad/6a/e3da701783788dec53ef94f2b3aacd53a0dbf8ff1955c51634e96feb3326/daas-0.0.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8cc666abdbcb6afa510d983cdb86ae513ef00e0379ccf7dcbadfae1ac8455671",
"md5": "0457b9b8eb0251ed1635eb1e301b8478",
"sha256": "6ee6a46e3111ce0bc091af8db5f382d1318eff2dc7e2580eb583bc0e8317b47d"
},
"downloads": -1,
"filename": "daas-0.0.13.tar.gz",
"has_sig": false,
"md5_digest": "0457b9b8eb0251ed1635eb1e301b8478",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 111104,
"upload_time": "2024-06-15T11:16:15",
"upload_time_iso_8601": "2024-06-15T11:16:15.203307Z",
"url": "https://files.pythonhosted.org/packages/8c/c6/66abdbcb6afa510d983cdb86ae513ef00e0379ccf7dcbadfae1ac8455671/daas-0.0.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-15 11:16:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jiumi",
"github_project": "meio",
"github_not_found": true,
"lcname": "daas"
}