Documentation ¶
Index ¶
- Variables
- func AddScopedISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedISingletonByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedISingletonByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedISingletonWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddSingletonISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonISingletonByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddSingletonISingletonByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, ...)
- func AddSingletonISingletonWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddTransientISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientISingletonByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientISingletonByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientISingletonWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func GetISingletonDefinition(ctn di.Container) *di.Def
- func GetISingletonDefinitions(ctn di.Container) []*di.Def
- func RemoveAllISingleton(builder *di.Builder)
- type ISingleton
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeISingleton = di.GetInterfaceReflectType((*ISingleton)(nil))
ReflectTypeISingleton used when your service claims to implement ISingleton
Functions ¶
func AddScopedISingleton ¶
func AddScopedISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddScopedISingleton adds a type that implements ISingleton
func AddScopedISingletonByFunc ¶
func AddScopedISingletonByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedISingletonByFunc adds a type by a custom func
func AddScopedISingletonByFuncWithMetadata ¶ added in v0.1.217
func AddScopedISingletonByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedISingletonByFuncWithMetadata adds a type by a custom func
func AddScopedISingletonWithMetadata ¶ added in v0.1.217
func AddScopedISingletonWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedISingletonWithMetadata adds a type that implements ISingleton
func AddSingletonISingleton ¶
func AddSingletonISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonISingleton adds a type that implements ISingleton
func AddSingletonISingletonByFunc ¶
func AddSingletonISingletonByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonISingletonByFunc adds a type by a custom func
func AddSingletonISingletonByFuncWithMetadata ¶ added in v0.1.217
func AddSingletonISingletonByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonByFuncWithMetadata adds a type by a custom func
func AddSingletonISingletonByObj ¶
func AddSingletonISingletonByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonByObj adds a prebuilt obj
func AddSingletonISingletonByObjWithMetadata ¶ added in v0.1.217
func AddSingletonISingletonByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonByObjWithMetadata adds a prebuilt obj
func AddSingletonISingletonWithMetadata ¶ added in v0.1.217
func AddSingletonISingletonWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonWithMetadata adds a type that implements ISingleton
func AddTransientISingleton ¶
func AddTransientISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientISingleton adds a type that implements ISingleton
func AddTransientISingletonByFunc ¶
func AddTransientISingletonByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientISingletonByFunc adds a type by a custom func
func AddTransientISingletonByFuncWithMetadata ¶ added in v0.1.217
func AddTransientISingletonByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientISingletonByFuncWithMetadata adds a type by a custom func
func AddTransientISingletonWithMetadata ¶ added in v0.1.217
func AddTransientISingletonWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientISingletonWithMetadata adds a type that implements ISingleton
func GetISingletonDefinition ¶ added in v0.1.217
GetISingletonDefinition returns that last definition registered that this container can provide
func GetISingletonDefinitions ¶ added in v0.1.217
GetISingletonDefinitions returns all definitions that this container can provide
func RemoveAllISingleton ¶
RemoveAllISingleton removes all ISingleton from the DI
Types ¶
type ISingleton ¶
ISingleton ...
func GetISingletonFromContainer ¶
func GetISingletonFromContainer(ctn di.Container) ISingleton
GetISingletonFromContainer alternative to SafeGetISingletonFromContainer but panics of object is not present
func GetManyISingletonFromContainer ¶
func GetManyISingletonFromContainer(ctn di.Container) []ISingleton
GetManyISingletonFromContainer alternative to SafeGetManyISingletonFromContainer but panics of object is not present
func SafeGetISingletonFromContainer ¶
func SafeGetISingletonFromContainer(ctn di.Container) (ISingleton, error)
SafeGetISingletonFromContainer trys to get the object by type, will not panic, returns nil and error
func SafeGetManyISingletonFromContainer ¶
func SafeGetManyISingletonFromContainer(ctn di.Container) ([]ISingleton, error)
SafeGetManyISingletonFromContainer trys to get the object by type, will not panic, returns nil and error