Home  >  Article  >  Backend Development  >  How can I connect to AppEngine Datastore in development using the Cloud Datastore API with Go?

How can I connect to AppEngine Datastore in development using the Cloud Datastore API with Go?

Linda Hamilton
Linda HamiltonOriginal
2024-10-25 00:21:02989browse

How can I connect to AppEngine Datastore in development using the Cloud Datastore API with Go?

Connecting to AppEngine Datastore in Development via Cloud Datastore API

You're looking to use the GCE instance to interact with the AppEngine datastore via the Cloud Datastore API. Below is a response to your posed issue.

Currently, this functionality is not supported in the development environment due to the different storage implementation used by the Java development server for Cloud Datastore and the Python development server for App Engine. This issue is being tracked on GitHub.

Developing a Google Cloud Datastore application in Go is feasible, but the go client library may encounter bugs. Notably, the development server does not support the JSON API used by the go library.

Update:

An alternative suggestion from proppy involves utilizing the Cloud Datastore Protobuf HTTP API with Go.

Note that you can still use Cloud Datastore Protobuf HTTP API with Go. The protobuf definition is available on GitHub, you can compile it to Go code using the Go protobuf compiler plugin and then send POST HTTP requests to /datastore/{version}/datasets/{datasetId}/{method}.

This approach enables you to use the Cloud Datastore API through Protobuf requests. However, it requires manual HTTP request crafting and prevents data sharing between your application and the Cloud Datastore in development.

The above is the detailed content of How can I connect to AppEngine Datastore in development using the Cloud Datastore API with Go?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn