Skip to main content

sdk调用

Project description

sdk

实现sdk调用中mqtt,http,rpc

如何写sdk调用其他服务http接口

要写A服务的sdk,A服务提供了1个http接口login,确定参数,在方法中实现具体的调用,如调用地址,使用post/get/put/patch等,最后返回结果

ret = SdkInterface.login(username="admin", password="c93ccd78b2076528346216b3b2f701e6", http_api_version="4.7.1")

要写A服务的sdk,A服务提供了1个rpc接口,确定参数,在方法中实现具体的调用,如调用地址,console服务名,最后返回结果

SdkInterface.query_check(data=param)

要写A服务的sdk,A服务需要一个topic,定义topic数据结构,

ret2 = SdkInterface.check(param=param)

订阅A服务topic, 定义回调函数,在回调函数中处理数据

SdkInterface.test_subscribe(lambda client, userdata, msg: print(msg.payload))

包制作

https://zhuanlan.zhihu.com/p/79164800

  • python3.9 -m pip install --user --upgrade setuptools wheel twine
  • python3.9 setup.py sdist bdist_wheel
  • python3.9 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

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

gs_sdk-2.0.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gs_sdk-2.0.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file gs_sdk-2.0.0.tar.gz.

File metadata

  • Download URL: gs_sdk-2.0.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for gs_sdk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5fbbcc5e979e11d275e11e4066e0149d746f9f5f5023a180f699ecf121c70342
MD5 8596225eb5da2e4d11396e320fe6053f
BLAKE2b-256 fdde9eac04e40baab27f29c2402cb5b41a6455a62eec1dacd29e9b893c69eb1d

See more details on using hashes here.

File details

Details for the file gs_sdk-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: gs_sdk-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for gs_sdk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 273dc3925ae05e16de4457df8c393d7d1fb4134e3364b97ec11334f231232587
MD5 ffd6904cb0b0b50a9d536393302eea78
BLAKE2b-256 ff6fdcede51dbdb2d58b6096976e193c39c79bdd248fe6fc550984558adc815a

See more details on using hashes here.

Supported by

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