grpc golang을 사용하여 클라이언트와 서버 응용 프로그램간에 통신합니다. 다음은 protoc 버퍼의 코드입니다.gRPC protoc 버퍼에서 map [string] 인터페이스 {} 변수를 생성합니다.
syntax = "proto3";
package Trail;
service TrailFunc {
rpc HelloWorld (Request) returns (Reply) {}
}
// The request message containing the user's name.
message Request {
map<string,string> inputVar = 1;
}
// The response message containing the greetings
message Reply {
string outputVar = 1;
}
map [string] 문자열 대신 message 데이터 구조 내에 map [string] interface {} 유형의 필드 inputVar를 만들어야합니다. 어떻게 구현할 수 있습니까? 미리 감사드립니다.
을. 하지만'map'가 작동 할 수도 있습니다. –
Vatine