DefaultContainer is the default implementation of the Container interface. It manages component definitions, singleton instances, custom scopes, and lifecycle processing.
| 59 | // It manages component definitions, singleton instances, custom scopes, |
| 60 | // and lifecycle processing. |
| 61 | type DefaultContainer struct { |
| 62 | definitions map[string]*Definition |
| 63 | muDefinitions sync.RWMutex |
| 64 | |
| 65 | singletons map[string]any |
| 66 | singletonState *creationState |
| 67 | typesOfSingletons map[string]reflect.Type |
| 68 | muSingletons sync.RWMutex |
| 69 | resolvableInstances map[reflect.Type]any |
| 70 | muResolvableInstances sync.RWMutex |
| 71 | |
| 72 | scopes map[string]Scope |
| 73 | muScopes sync.RWMutex |
| 74 | |
| 75 | preProcessors []PreProcessor |
| 76 | postProcessors []PostProcessor |
| 77 | muProcessors sync.RWMutex |
| 78 | } |
| 79 | |
| 80 | // NewDefaultContainer creates a DefaultContainer. |
| 81 | func NewDefaultContainer() *DefaultContainer { |
nothing calls this directly
no outgoing calls
no test coverage detected