MCPcopy Index your code
hub / github.com/labstack/echo / bindMetaFor

Function bindMetaFor

bind.go:184–205  ·  view source on GitHub ↗

map[reflect.Type]*bindStructMeta

(typ reflect.Type)

Source from the content-addressed store, hash-verified

182var bindStructCache sync.Map // map[reflect.Type]*bindStructMeta
183
184func bindMetaFor(typ reflect.Type) *bindStructMeta {
185 if cached, ok := bindStructCache.Load(typ); ok {
186 return cached.(*bindStructMeta)
187 }
188 n := typ.NumField()
189 meta := &bindStructMeta{fields: make([]bindFieldMeta, n)}
190 for i := 0; i < n; i++ {
191 f := typ.Field(i)
192 meta.fields[i] = bindFieldMeta{
193 index: i,
194 anonymous: f.Anonymous,
195 fieldKind: f.Type.Kind(),
196 formatTag: f.Tag.Get("format"),
197 param: f.Tag.Get("param"),
198 query: f.Tag.Get("query"),
199 form: f.Tag.Get("form"),
200 header: f.Tag.Get("header"),
201 }
202 }
203 bindStructCache.Store(typ, meta)
204 return meta
205}
206
207// bindData will bind data ONLY fields in destination struct that have EXPLICIT tag
208func bindData(destination any, data map[string][]string, tag string, dataFiles map[string][]*multipart.FileHeader) error {

Callers 1

bindDataFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…