Init populates the properties from a protocol buffer struct tag. Deprecated: Do not use.
(typ reflect.Type, name, tag string, f *reflect.StructField)
| 194 | // |
| 195 | // Deprecated: Do not use. |
| 196 | func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) { |
| 197 | p.Name = name |
| 198 | p.OrigName = name |
| 199 | if tag == "" { |
| 200 | return |
| 201 | } |
| 202 | p.Parse(tag) |
| 203 | |
| 204 | if typ != nil && typ.Kind() == reflect.Map { |
| 205 | p.MapKeyProp = new(Properties) |
| 206 | p.MapKeyProp.Init(nil, "Key", f.Tag.Get("protobuf_key"), nil) |
| 207 | p.MapValProp = new(Properties) |
| 208 | p.MapValProp.Init(nil, "Value", f.Tag.Get("protobuf_val"), nil) |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | var propertiesCache sync.Map // map[reflect.Type]*StructProperties |
| 213 |