【发布时间】:2021-11-05 03:33:24
【问题描述】:
我很想将 python 模式代码复制到 golang(protobuf)。我被困在其中一种情况。
message Type1 {
enum Type{
type1 = 1
}
Type type = 0;
string name = 1;
}
message Type2 {
enum Type{
type2 = 1
}
Type type = 0;
string name = 1;
repeated string value = 2;
}
message Type3 {
enum Type{
time = 1
}
Type type = 0;
string name = 1;
string format = 2;
string value = 3;
}
message Request {
something
something
map<string, oneof_above_defined_types> params = n
}
如何确保地图只接受上面定义的自定义类型?
【问题讨论】:
标签: go protocol-buffers proto