Documentation ¶
Index ¶
- Variables
- func AddScopedISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedISingletonByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonISingletonByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddTransientISingleton(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientISingletonByFunc(builder *di.Builder, implType reflect.Type, ...)
- 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 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 AddSingletonISingletonByObj ¶
func AddSingletonISingletonByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonByObj adds a prebuilt obj
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 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