简体   繁体   English

从Qt应用访问Cloud Datastore

[英]Accessing Cloud Datastore from Qt app

I've developed a REST API back end using Endpoints-Proto-Datastore, which wraps the Cloud Endpoints Python API. 我已经使用Endpoints-Proto-Datastore开发了REST API后端,该后端包装了Cloud Endpoints Python API。 I'm starting to look at Qt and trying to get an idea what will be involved in accessing my API from the Qt networking or other library. 我开始研究Qt,并试图了解从Qt网络或其他库访问我的API会涉及什么。 Might it be nearly as straightforward as is making the calls from the command line using the Python Client library, which even handles OAuth2 flows? 可能与使用甚至可以处理OAuth2流的Python客户端库从命令行进行调用一样简单吗? This would be very nice. 这将是非常好的。 I might use PyQt if this makes things simpler. 如果可以简化事情,我可能会使用PyQt。

Your Endpoints service can generate an OpenAPI specification file which describes the API. 您的Endpoints服务可以生成描述API的OpenAPI规范文件。 Once you do this, there are many OpenAPI-compatible packages which can generate client code for you. 完成此操作后,将有许多与OpenAPI兼容的软件包可以为您生成客户端代码。

I located this document which gives a pretty good overview for my purposes: 我找到了该文档该文档针对我的目的进行了很好的概述:

"The Google APIs Client Library for C++ will automatically take care of many of the tedious details for interpreting and complying with the discovery documents so that you can write simpler and familiar C++ code." “用于C ++的Google API客户端库将自动处理许多繁琐的细节,以解释和遵守发现文档,以便您可以编写更简单和熟悉的C ++代码。”

Now it's a matter of building and installing the C++ client and then figuring out how to generate the client library and access it from a Qt application. 现在,需要构建和安装C ++客户端,然后弄清楚如何生成客户端库并从Qt应用程序访问它。 But that is beyond the scope of this question. 但这超出了这个问题的范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM