mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-04 20:14:56 +00:00
12 lines
282 B
Go
12 lines
282 B
Go
package dependency
|
|
|
|
var typeInitializerMap = make(map[ContainerType]func() interface{}, 0)
|
|
|
|
func RegisterGenerator(name ContainerType, fn func() interface{}) {
|
|
typeInitializerMap[name] = fn
|
|
}
|
|
|
|
func GetInstance(name ContainerType) interface{} {
|
|
return typeInitializerMap[name]()
|
|
}
|