草庐IT

endpoints-proto-datastore

全部标签

go - 使用 Go 模块时生成 in-repo protos 的最佳实践

tl;dr以前配置为使用GOPATH的repo现在配置为模块。一切都很好,越来越好。但是,protoc正确地(!)为在github.com/path/to/repo/protos结构中的repo中定义的protobufs生成Golang代码,而我现在更喜欢在我的源代码中生成这些代码,在GOPATH之外。我正在移动他们来解决这个问题。有更好的解决方案吗?我有一个GitHub存储库。为了方便讨论,我们称它为github.com/acme/toolbox。在子目录中,我有protobuf文件,其中包括:packageacme.toolbox.v1;optiongo_package="gith

google-app-engine - 如何使用结构数组实现 google datastore propertyloadsaver

当你有一个结构数组时,你如何为谷歌数据存储实现Load()和Save()?这显然是可能的,但如何实现呢?首先,当您允许数据​​存储本身使用Phone对象列表序列化一个Person时,您可以使用反射来查看它在内部创建了一个列表>*datastore.Entity对象:packagemainimport("fmt""reflect""cloud.google.com/go/datastore")typePhonestruct{TypestringNumberstring}typePersonstruct{NamestringPhone[]Phone}funcmain(){person:=P

google-app-engine - 祖先查询导致 API 错误 4 (datastore_v3 : NEED_INDEX): no matching index found error

我在处理祖先查询时遇到了很大的困难。这是有效的代码:...uk:=datastore.NewKey(c,config.DatastoreDuelIdKind,did,0,nil)_,err:=datastore.NewQuery(config.DatastoreQuestionInDuelKind).Ancestor(uk).GetAll(c,&roundsPlayedInDuel)...上面的代码产生了正确的结果。现在,如果我在config.DatastoreQuestionInDuelKind的属性上添加Order过滤器,查询将失败并出现NEED_INDEX错误。但是这个失败了:_

unit-testing - 使用 aetest.NewContext 代替 endpoints.NewContext 以强一致性测试 go-endpoints

我有一个搜索方法:func(sa*SearchApi)Search(cendpoints.Context,r*SearchQuery)(*SearchResults,error){..}如您所见,它需要一个端点。上下文例如:ctx:=endpoints.NewContext(req1)但是对于aetest,我使用的是不同的上下文:otherCtx,err:=aetest.NewContext(&aetest.Options{"",true})特别是这个上下文有额外的强一致性选项-因为我正在设置数据所以我可以测试一个只读的api。我无法将otherCxt传递给我的Search方法,因为它

go - 如何将 http.Request 包装到 proto 文件中

我需要将http.Request包装到proto文件中,以便我可以从客户端向服务器端发送请求实例,如以下代码所示:messageWrapRequest{*http.Requestrequest=1;//thisiswrongint64start=2;int64stop=3;boolmatch=4;stringruleid=5;}我确定我代码中的请求行是错误的,有没有人知道如何实现它。非常感谢。 最佳答案 您可以不传递http.Request而传递http.Request.Body或http.Request.Header取决于做什么你

windows - gcloud beta emulators datastore 在谷歌云SDK安装中启动错误

我尝试安装Google的云SDK但没有成功,因为我在尝试启动模拟器后遇到了以下错误。WARNING:Reusingexistingdatain[C:\Users\User\AppData\Roaming\gcloud\emulators\datastore].Executing:cmd/cC:\ProgramFiles(x86)\Google\CloudSDK\google-cloud-sdk\platform\cloud-datastore-emulator\cloud_datastore_emulator.cmdstart--host=localhost--port=8900--s

Python/twisted 在 Windows 上导入 twisted.internet.endpoints

我正在尝试在python上使用twisted编写服务器。这是我文件的头部:fromtwisted.internet.protocolimportFactory,Protocolfromtwisted.internet.endpointsimportTCP4ServerEndpointfromtwisted.internetimportreactor第一个和最后一个导入工作完美。尝试使用以下回溯运行第二次导入时出现错误:Traceback(mostrecentcalllast):File"",line1,infromtwisted.internet.endpointsimportTCP4

windows - mftraining 给出警告 : no protos/configs for F in CreateIntTemplates()

编辑:mftraining在标题中为unicharset中的所有字符发出警告(因此不仅是F,还有a、b、c、d等)我如何创建这些原型(prototype)/配置?我正在关注this教程现在解决的上一个问题:-Error:AssertfailedWarning:infile....\classify\trainingsampleset.cpp,line622noprotos/SegmentationFault这是整个命令+输出:-C:\training>mftraining-Ffont_properties-Uunicharset-Oeng.unicharseteng.impact.bo

c# - "Service X has zero application endpoints"除非我在代码中添加端点 - 为什么?

我关注了thisMSDNarticle彻底创建托管在托管NT服务中的WCF服务。当我在服务控制台中单击“开始”时,我会在事件查看器中看到以下内容:Servicecannotbestarted.System.InvalidOperationException:Service'MyServiceNamespace.RequestProcessorImpl'haszeroapplication(non-infrastructure)endpoints.Thismightbebecausenoconfigurationfilewasfoundforyourapplication,orbecau

c# - WCF Web 服务错误 : "Service endpoint binding not using HTTP protocol"?

我有一个简单的WCF服务,在我的开发机器上测试时它运行良好。现在我已将Web服务移至Web服务器,并在http://mydomain.com:8005运行该服务(在Debug模式下).打开Web浏览器访问该URL会显示预期的服务页面,如果我在我正在调用的界面内的服务器上放置一个断点,它会命中断点并返回预期的数据......但在客户端它会返回出现以下错误:AnerroroccurredwhilereceivingtheHTTPresponsetohttp://mydomain.com:8005/.Thiscouldbeduetotheserviceendpointbindingnotus