go - Create variable of type Map[string]interface{} in gRPC protoc buffer golang -
i'm using grpc golang communicate between client , server application. below code protoc buffer.
syntax = "proto3"; package trail; service trailfunc { rpc helloworld (request) returns (reply) {} } // request message containing user's name. message request { map<string,string> inputvar = 1; } // response message containing greetings message reply { string outputvar = 1; }
i need create field inputvar of type map[string]interface{} inside message data structure instead of map[string]string. how can achieve it? in advance.
proto3 has type any
import "google/protobuf/any.proto"; message errorstatus { string message = 1; repeated google.protobuf.any details = 2; }
but if @ implementation, as
message { string type_url = 1; bytes value = 2; }
you have define such message possibly using reflection , intermediate type.
Comments
Post a Comment