@@ -41,6 +41,7 @@ var pcommon = &Package{
41
41
},
42
42
},
43
43
structs : []baseStruct {
44
+ anyValueStruct ,
44
45
arrayValueStruct ,
45
46
keyValueListStruct ,
46
47
anyValueSlice ,
@@ -94,6 +95,69 @@ var mapStruct = &messageSlice{
94
95
element : keyValue ,
95
96
}
96
97
98
+ var anyValue = & messageStruct {
99
+ structName : "Value" ,
100
+ packageName : "pcommon" ,
101
+ originFullName : "otlpcommon.AnyValue" ,
102
+ }
103
+
104
+ // anyValueStruct needs to be different from anyValue because otherwise we cause initialization circular deps with mapStruct.
105
+ var anyValueStruct = & messageStruct {
106
+ structName : "Value" ,
107
+ originFullName : "otlpcommon.AnyValue" ,
108
+ fields : []Field {
109
+ & OneOfField {
110
+ typeName : "MetricType" ,
111
+ originFieldName : "Value" ,
112
+ testValueIdx : 1 , //
113
+ omitOriginFieldNameInNames : true ,
114
+ values : []oneOfValue {
115
+ & OneOfPrimitiveValue {
116
+ fieldName : "StringValue" ,
117
+ protoID : 1 ,
118
+ originFieldName : "StringValue" ,
119
+ protoType : proto .TypeString ,
120
+ },
121
+ & OneOfPrimitiveValue {
122
+ fieldName : "BoolValue" ,
123
+ protoID : 2 ,
124
+ originFieldName : "BoolValue" ,
125
+ protoType : proto .TypeBool ,
126
+ },
127
+ & OneOfPrimitiveValue {
128
+ fieldName : "IntValue" ,
129
+ protoID : 3 ,
130
+ originFieldName : "IntValue" ,
131
+ protoType : proto .TypeInt64 ,
132
+ },
133
+ & OneOfPrimitiveValue {
134
+ fieldName : "DoubleValue" ,
135
+ protoID : 4 ,
136
+ originFieldName : "DoubleValue" ,
137
+ protoType : proto .TypeDouble ,
138
+ },
139
+ & OneOfMessageValue {
140
+ fieldName : "ArrayValue" ,
141
+ protoID : 5 ,
142
+ returnMessage : arrayValueStruct ,
143
+ },
144
+ & OneOfMessageValue {
145
+ fieldName : "KvlistValue" ,
146
+ protoID : 6 ,
147
+ returnMessage : keyValueListStruct ,
148
+ },
149
+ & OneOfPrimitiveValue {
150
+ fieldName : "BytesValue" ,
151
+ protoID : 7 ,
152
+ originFieldName : "BytesValue" ,
153
+ protoType : proto .TypeBytes ,
154
+ },
155
+ },
156
+ },
157
+ },
158
+ hasOnlyOrig : true ,
159
+ }
160
+
97
161
var keyValueListStruct = & messageStruct {
98
162
structName : "KeyValueList" ,
99
163
description : "KeyValueList is a list of KeyValue messages. We need KeyValueList as a message since oneof in AnyValue does not allow repeated fields." ,
@@ -145,12 +209,6 @@ var timestampType = &TypedType{
145
209
testVal : "1234567890" ,
146
210
}
147
211
148
- var anyValue = & messageStruct {
149
- structName : "Value" ,
150
- packageName : "pcommon" ,
151
- originFullName : "otlpcommon.AnyValue" ,
152
- }
153
-
154
212
var traceIDType = & TypedType {
155
213
structName : "TraceID" ,
156
214
packageName : "pcommon" ,
0 commit comments