MCPcopy Create free account
hub / github.com/codnect/procyon / CanResolve

Method CanResolve

component/container.go:254–270  ·  view source on GitHub ↗

CanResolve checks if a component with the given name is resolvable.

(name string)

Source from the content-addressed store, hash-verified

252
253// CanResolve checks if a component with the given name is resolvable.
254func (d *DefaultContainer) CanResolve(name string) bool {
255 d.muSingletons.RLock()
256 defer d.muSingletons.RUnlock()
257
258 if _, exists := d.singletons[name]; exists {
259 return true
260 }
261
262 d.muDefinitions.RLock()
263 defer d.muDefinitions.RUnlock()
264
265 if _, exists := d.definitions[name]; exists {
266 return true
267 }
268
269 return false
270}
271
272// CanResolveType checks if a component of the given type is resolvable.
273func (d *DefaultContainer) CanResolveType(typ reflect.Type) bool {

Callers 1

Calls

no outgoing calls

Tested by 1