草庐IT

google-cloud-core-grpc

全部标签

google-app-engine - 谷歌应用引擎/啊/健康 "Method does not exist."

对projectname.appspot.com/_ah/health的请求返回以下错误{"code":5,"message":"Methoddoesnotexist.","details":[{"@type":"type.googleapis.com/google.rpc.DebugInfo","stackEntries":[],"detail":"service_control"}]}本地测试,效果很好。缩写的app.yaml:runtime:goenv:flexapi_version:go1app.go主要功能:funcmain(){r:=mux.NewRouter()r.Han

Golang GRPC 返回 EOF 错误

我正在使用http通过以下代码调用RPCfunc(c*CallClient)Wallet(methodstring,req,repinterface{})error{client:=&http.Client{}data,_:=EncodeClientRequest(method,req)reqest,_:=http.NewRequest("POST",c.endpoint,bytes.NewBuffer(data))resp,err:=client.Do(reqest)iferr!=nil{returnerr}deferresp.Body.Close()io.Copy(ioutil.D

google-app-engine - 在 Google App Engine 上解析多部分表单

我正在从事的一个项目依赖于托管在GoogleAppEngine上的服务从SendGrid解析。以下代码是我们正在做的事情的示例:packagesendgrid_failureimport("net/http""fmt""google.golang.org/appengine""google.golang.org/appengine/log")funcinit(){http.HandleFunc("/sendgrid/parse",sendGridHandler)}funcsendGridHandler(whttp.ResponseWriter,r*http.Request){ctx:=

google-app-engine - 我如何将第三方 Go 库与谷歌应用引擎的开发服务器一起使用?

在我的一个.go文件中我有:import(..."github.com/stripe/stripe-go""appengine""appengine/datastore")但是当我运行dev_appserver.pyapp.yaml时,出现以下错误:Can'tfindpackage"github.com/stripe/stripe-go"in$GOPATH我已经尝试运行gogetgithub.com/stripe/stripe-go我可以看到成功安装到~/go/src/github.com/stripe/stripe-go但出于某种原因,GAE开发服务器似乎没有查看该路径。gcloud

google-app-engine - 如何使用 "Put"获取 key 进入 RunInTransaction 而不是等到交易之后

我构建的数据库结构就像一条链,它看起来像这样:Clickheretoseethestructure这些部分在哪里:Clickheretoseewhatrepresentseachpart所以,当我想向我的链中添加新数据时:Clickheretoseethenewdatacoming,在我想要的任何地方,我可以通过更新结构的datastore.key轻松更新它们的值:clickheretoseetheupdate所以,在这种情况下,我只需要更新b.NextBlock、c.LastBlock、e.LastBlock和e.NextBlock一切都很好,但假设我想添加更多新数据Clickher

go - 如何从客户端发送 grpc 元数据

我在golang中使用grpc.Dial(server)来设置与我的服务器的grpc连接。如何通过此拨号连接(从客户端)发送元数据或自定义header? 最佳答案 我假设grpc是您的客户端连接对象。您使用来自map[string]string(提供的一些其他方法)的元数据子包创建元数据,然后通过上下文传递它,例如md:=metadata.New(map[string]string{"key1":"val1","key2":"val2"})ctx:=metadata.NewOutgoingContext(context.Backgr

google-app-engine - Mux 和 http.HandleFunc 都适用于 Google App Engine 上的 helloworld 端点

我无法让名为emptysuccess的处理程序工作。我正在将sendgrid变成一个appspot微服务。迄今为止调用http://localhost:8080/emptysuccess返回404pagenotfound这个行为是真实的dev_appserver.py和真正的appspot.com。如何让/emptysuccess工作?packagesendmailimport("fmt""github.com/sendgrid/sendgrid-go""net/http""google.golang.org/appengine""github.com/gorilla/mux""goo

google-app-engine - 云数据存储 client.GetAll 类型不匹配但 client.Get 有效

我正在appengine中编写一个go应用程序,它连接并返回来自datastore实体的一些信息。我遇到了一个问题,其中client.Get正在使用预定义结构,但client.GetAll抛出类型不匹配(反之亦然)。我对两者都使用以下结构:typemyStructstruct{IDint64Field1stringField2stringRelease_Datetime.Time}这在Release_Date被定义为time.Time时起作用(如果int则失败):k:=db.datastoreKey(id)myStruct:=&myStruct{}iferr:=db.client.Ge

python - 无法使用python客户端连接到go grpc服务器

我有一个在Go中运行的grpc服务器。我无法使用python客户端调用方法。不知道出了什么问题。我收到以下错误_RPC的会合以(StatusCode.UNIMPLEMENTED,method:/com.test/myMethod)>结束知道哪里出了问题吗?Go客户端能够正常通信。我还按照说明生成了stubhttps://grpc.io/docs/tutorials/basic/python.htmlpython-mgrpc_tools.protoc-I../../protos--python_out=.--grpc_python_out=.../../protos/route_guid

elasticsearch - 在 google go 中使用 olivere/elastic 通过 ElasticSearch 中的查询更新记录

我在我的go应用程序中使用olivere/elastic库进行Elasticsearch。我有elasticsearch文档的特定字段(比如fieldA)的值列表。我想通过搜索字段fieldA来更新所有文档的特定字段。这个:UpdatingarecordinElasticSearchusingolivere/elasticingooglego解释更新部分。但就我而言,没有要更新的文档ID。所以,要么我可以进行搜索调用以检索文档ID,然后更新它们,要么还有另一种方法丢失了吗?提前致谢。 最佳答案 如果需要更新文件列表,可以使用Upda