MCPcopy
hub / github.com/danielgtaylor/huma / findResolvers

Function findResolvers

huma.go:270–278  ·  view source on GitHub ↗

findResolvers searches a given type for resolvers matching a specified resolverType. It returns a findResult indicating whether such resolvers were found.

(resolverType, t reflect.Type)

Source from the content-addressed store, hash-verified

268// findResolvers searches a given type for resolvers matching a specified resolverType.
269// It returns a findResult indicating whether such resolvers were found.
270func findResolvers(resolverType, t reflect.Type) *findResult[bool] {
271 return findInType(t, func(t reflect.Type, path []int) bool {
272 tp := reflect.PointerTo(t)
273 if tp.Implements(resolverType) || tp.Implements(resolverWithPathType) {
274 return true
275 }
276 return false
277 }, nil, true)
278}
279
280// findDefaults identifies struct fields with "default" tags and attempts to resolve
281// their values using the provided registry.

Callers 1

RegisterFunction · 0.85

Calls 1

findInTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…