TypeMap returns a mapping of field strings to int slices representing the traversal down the struct to reach the field.
(t reflect.Type)
| 102 | // TypeMap returns a mapping of field strings to int slices representing |
| 103 | // the traversal down the struct to reach the field. |
| 104 | func (m *Mapper) TypeMap(t reflect.Type) *StructMap { |
| 105 | m.mutex.Lock() |
| 106 | mapping, ok := m.cache[t] |
| 107 | if !ok { |
| 108 | mapping = getMapping(t, m.tagName, m.mapFunc, m.tagMapFunc) |
| 109 | m.cache[t] = mapping |
| 110 | } |
| 111 | m.mutex.Unlock() |
| 112 | return mapping |
| 113 | } |
| 114 | |
| 115 | // FieldMap returns the mapper's mapping of field names to reflect values. Panics |
| 116 | // if v's Kind is not Struct, or v is not Indirectable to a struct kind. |