Definition retrieves the component definition associated with the given name. Returns the definition and a boolean indicating its existence.
(name string)
| 139 | // Definition retrieves the component definition associated with the given name. |
| 140 | // Returns the definition and a boolean indicating its existence. |
| 141 | func (d *DefaultContainer) Definition(name string) (*Definition, bool) { |
| 142 | d.muDefinitions.RLock() |
| 143 | defer d.muDefinitions.RUnlock() |
| 144 | |
| 145 | if def, exists := d.definitions[name]; exists { |
| 146 | return def, true |
| 147 | } |
| 148 | |
| 149 | return nil, false |
| 150 | } |
| 151 | |
| 152 | // ContainsDefinition checks whether a component definition with the specified name exists. |
| 153 | func (d *DefaultContainer) ContainsDefinition(name string) bool { |
no outgoing calls