Skip to main content

Open RPC.

Project description

orpc

Open RPC.

Install

pip install orpc

Client Install

pip install orpc-client

Protocol

oRPC request

  • request_package = 4bytes-length-byteorder-big + msgstack.dumps(request_body)
  • request_body = {"event": "xxx", "args": [], "kwargs": {}}

oRPC response

  • response_package = 4bytes-length-byteorder-big + msgstack.dumps(response_body)
  • response_body = {"result": xx, "code": 0, "message": "xxx"}

simple orpc server usage

Configs

  • server.listen: 0.0.0.0
  • server.port 8392
  • server.backlog: 8192
  • server.buffer_size: 4096
  • server.rfile_buffer_size: buffer_size
  • server.wfile_buffer_size: buffer_size
  • max_request_size: 4194304
  • result_packer: zenutils.packutils.RcmPacker
  • authentication.enable
  • authentication.event
  • authentication.users
  • services
  • enable-debug-service

More configs see pypi package daemon-application.

  • services is a list of dict which item contains fields below:
    • class: str
    • args: list
    • kwargs: dict
  • authentication.users is a username and password dict.
  • The authentication.event service takes _protocol_instance as a keyword parameter.
  • Set _protocol_instance.authenticated flag to True if login success.
  • The authentication.event service's password parameter must be given in hash format, e.g. {SSM3}tcvAvgJqVjqC661OmZewsweDma4AOVaXruOtnCFqZrJoTllTYlNvcw==, a salted sm3 hash.

Command Help

test@testdeMacBook-Pro orpc % orpc --help
Usage: orpc [OPTIONS] COMMAND [ARGS]...

Options:
  --logfmt TEXT
  --logfile TEXT
  --loglevel TEXT
  --pidfile TEXT          pidfile file path.
  --workspace TEXT        Set running folder
  --daemon / --no-daemon  Run application in background or in foreground.
  -c, --config TEXT       Config file path. Application will search config
                          file if this option is missing. Use sub-command
                          show-config-fileapaths to get the searching tactics.
  --help                  Show this message and exit.

Commands:
  restart                Restart Daemon application.
  show-config-filepaths  Print out the config searching paths.
  show-configs           Print out the final config items.
  start                  Start daemon application.
  stop                   Stop daemon application.

Releases

v0.1.0

  • First release.

v0.1.2

  • Add oRPC connection auto login support.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orpc-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

orpc-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file orpc-0.1.2.tar.gz.

File metadata

  • Download URL: orpc-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for orpc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b30cd4d7b92e4f390841b6b1041974b34d4f3f079771416945d8fc5c241eeb28
MD5 f0b0ef530f9ee9707757f7b862a58dbb
BLAKE2b-256 e576a63d8321eb9c578c747235784964b851a41b07a3bf6c3cc295428b56c3d3

See more details on using hashes here.

File details

Details for the file orpc-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: orpc-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for orpc-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aafb87e5f3bdde87cf0a7c7d9929adf606cb4b69463fb010d014431101cdd56c
MD5 1b91cd1c457db3860ca7f35ec5feef9c
BLAKE2b-256 b097a991f0ea96bdbce38f7d31964fc6772499dc17cc8080b17eb0336b6c777d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page