天道酬勤,学无止境

proto

Protoc C# Google Assistant .proto "Was Not Found Or Has Errors"

问题 我想使用 gRPC 与 Google Assistant SDK 通信。 我下载了 embedded_assistant.proto 并在 CMD 中运行了这个命令: protoc -I=I:"\PC Folders\Downloads\proto3.3.0win32\bin" --csharp_out=$DST_DIR "I:\PC Folders\Downloads\proto3.3.0win32\bin\embedded_assistant.proto" 然后它给了我这些错误: google/api/annotations.proto:找不到文件。 google/rpc/status.proto:找不到文件。 Embedded_assistant.proto:导入“google/api/annotations.proto”未找到或有错误。 Embedded_assistant.proto:导入“google/rpc/status.proto”未找到或有错误。 Embedded_assistant.proto:270:5:“google.rpc.Status”未定义。 我怎样才能解决这个问题? 我使用了这个 proto 编译器:https://github.com/google/protobuf/releases 并在底部显示 protoc-3.3.0-win32.zip

2022-05-02 07:00:31    分类:技术分享    c#   grpc   proto   google-assistant-sdk

Why if F - simple function: F.prototype!== F.__proto__ but Function.prototype === Function.__proto__?

问题 为什么如果F - 简单函数: F.prototype !== F.__proto__ 但 Function.prototype === Function.__proto__ ? 回答1 F.prototype !== F.__proto__ 假设您正在为所有函数设计一个 API。 所以你定义每个函数都应该有方法call 。 你用这样的方法创建一个对象: var fproto = {call: ()=>{}}; 然后,要让所有函数共享此功能,您必须将其添加到 Function 构造函数的.prototype属性中,以便 Function 的所有实例都继承它。 因此,您执行以下操作: Function.prototype = fproto. 现在,当您创建一个函数F时,它的.__proto__将设置为fproto : const F = new Function(); F.call(); // works because of lookup in prototype chain through `__proto__` property F.__proto__ === Function.prototype; // true 现在您决定使用F构造函数创建的所有实例都应该有一个方法custom

2022-05-02 06:43:35    分类:技术分享    javascript   oop   prototype   proto   function.prototype

How to get all Fields names in golang proto generated complex structs

I am trying to get all the fields names in the go file generated from proto. Below is the generated struct. type Action struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to ActionType: // *Action_TaskAction ActionType isAction_ActionType `protobuf_oneof:"action_type"` } As it is seen that ActionType is oneof Field in proto which is implemented as below. type isAction_ActionType interface { isAction_ActionType() } type Action_TaskAction struct { TaskAction *TaskAction `protobuf:"bytes,16,opt,name=task_action,json

2022-05-02 03:44:47    分类:问答    go   struct   protocol-buffers   proto   protobuf-go

Protobuf timestamp not found

Relatively new to GRPC and getting an error in my proto file that I cannot seem to make sense of. I would like to send a time in a message using the "google.protobuf.Timestamp". I cannot seem to import it. What am I doing wrong? syntax = "proto3"; import "google/protobuf/timestamp.proto"; service ProfileService { rpc ConstructProfileStructFromUser (ConstructProfileStructFromUserRequest) returns (ConstructProfileStructFromUserResponse); } message ConstructProfileStructFromUserRequest { string transactionID = 1; string User = 2; } message ConstructProfileStructFromUserResponse { string UID = 1

2022-05-01 17:00:58    分类:问答    protocol-buffers   grpc   proto

How value to __proto__ is assigned in javascript?

Recently I have been playing with javaScript prototype object and came across below example. function Foo(){ } Foo.prototype=null; var fooObj=new Foo(); When I look at the fooObj from developer tools, the __proto__ property points to the global Object's prototype and I can access all properties and function defined in Object's prototype object. which should point to Foo function's prototype object, since I have assigned null to it I was expecting __proto__ will point to null, Pointing __proto__ might make more sense but I want to understand how value is assigned to __proto__ after object

2022-03-24 19:39:10    分类:问答    javascript   inheritance   prototype   proto

Why if F - simple function: F.prototype!== F.__proto__ but Function.prototype === Function.__proto__?

Why if F - simple function: F.prototype !== F.__proto__ but Function.prototype === Function.__proto__ ?

2022-03-21 14:47:46    分类:问答    javascript   oop   prototype   proto   function.prototype

Protoc C# Google Assistant .proto "Was Not Found Or Has Errors"

I want to communicate with the Google Assistant SDK using gRPC. I downloaded the embedded_assistant.proto and ran this command in CMD: protoc -I=I:"\PC Folders\Downloads\proto3.3.0win32\bin" --csharp_out=$DST_DIR "I:\PC Folders\Downloads\proto3.3.0win32\bin\embedded_assistant.proto" It then gave me these errors: google/api/annotations.proto: File not found. google/rpc/status.proto: File not found. embedded_assistant.proto: Import "google/api/annotations.proto" was not found or had errors. embedded_assistant.proto: Import "google/rpc/status.proto" was not found or had errors. embedded_assistant

2022-03-21 11:18:54    分类:问答    c#   grpc   proto   google-assistant-sdk