daas


Namedaas JSON
Version 0.0.10 PyPI version JSON
download
home_pagehttps://github.com/jiumi/meio
SummaryA lightweight, distributed, relational network architecture for MPC.
upload_time2024-03-10 21:27:46
maintainercoyzeng
docs_urlNone
authorcoyzeng
requires_python>=3.8,<4.0
licenseLICENSE
keywords servicemesh rpc codec cluster registry
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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": ">=3.8,<4.0",
    "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/52/20/f5262c805953b83de07f534a8cc5c9d31084f8b1f78bbc84e8199ad9dd65/daas-0.0.10.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.10",
    "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": "73f01a357f033c73b17af5a1fe5aa15c19e334e1ccc07950ea72d83458f41cd9",
                "md5": "e2b192e5af25a869cdc1417215cd11ca",
                "sha256": "d867a2f176e2ab118355eeb4040cf704664a130ab9f4a7c2c5e0cb752384d0cb"
            },
            "downloads": -1,
            "filename": "daas-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e2b192e5af25a869cdc1417215cd11ca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 181048,
            "upload_time": "2024-03-10T21:27:43",
            "upload_time_iso_8601": "2024-03-10T21:27:43.543310Z",
            "url": "https://files.pythonhosted.org/packages/73/f0/1a357f033c73b17af5a1fe5aa15c19e334e1ccc07950ea72d83458f41cd9/daas-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5220f5262c805953b83de07f534a8cc5c9d31084f8b1f78bbc84e8199ad9dd65",
                "md5": "ed7882a6f8efc02677ef14bb563c6440",
                "sha256": "84941edb73e9966bf45f45ae11f163080d849eba322f2265c856f29ebb0a8fe6"
            },
            "downloads": -1,
            "filename": "daas-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "ed7882a6f8efc02677ef14bb563c6440",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 111007,
            "upload_time": "2024-03-10T21:27:46",
            "upload_time_iso_8601": "2024-03-10T21:27:46.270966Z",
            "url": "https://files.pythonhosted.org/packages/52/20/f5262c805953b83de07f534a8cc5c9d31084f8b1f78bbc84e8199ad9dd65/daas-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-10 21:27:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jiumi",
    "github_project": "meio",
    "github_not_found": true,
    "lcname": "daas"
}
        
Elapsed time: 0.20190s