Documentation ¶
Index ¶
- Variables
- func AddScopedITransient(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedITransientByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonITransient(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonITransientByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonITransientByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddTransientITransient(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientITransientByFunc(builder *di.Builder, implType reflect.Type, ...)
- func RemoveAllITransient(builder *di.Builder)
- type ITransient
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeITransient = di.GetInterfaceReflectType((*ITransient)(nil))
ReflectTypeITransient used when your service claims to implement ITransient
Functions ¶
func AddScopedITransient ¶
func AddScopedITransient(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddScopedITransient adds a type that implements ITransient
func AddScopedITransientByFunc ¶
func AddScopedITransientByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedITransientByFunc adds a type by a custom func
func AddSingletonITransient ¶
func AddSingletonITransient(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonITransient adds a type that implements ITransient
func AddSingletonITransientByFunc ¶
func AddSingletonITransientByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonITransientByFunc adds a type by a custom func
func AddSingletonITransientByObj ¶
func AddSingletonITransientByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonITransientByObj adds a prebuilt obj
func AddTransientITransient ¶
func AddTransientITransient(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientITransient adds a type that implements ITransient
func AddTransientITransientByFunc ¶
func AddTransientITransientByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientITransientByFunc adds a type by a custom func
func RemoveAllITransient ¶
RemoveAllITransient removes all ITransient from the DI
Types ¶
type ITransient ¶
ITransient ...
func GetITransientFromContainer ¶
func GetITransientFromContainer(ctn di.Container) ITransient
GetITransientFromContainer alternative to SafeGetITransientFromContainer but panics of object is not present
func GetManyITransientFromContainer ¶
func GetManyITransientFromContainer(ctn di.Container) []ITransient
GetManyITransientFromContainer alternative to SafeGetManyITransientFromContainer but panics of object is not present
func SafeGetITransientFromContainer ¶
func SafeGetITransientFromContainer(ctn di.Container) (ITransient, error)
SafeGetITransientFromContainer trys to get the object by type, will not panic, returns nil and error
func SafeGetManyITransientFromContainer ¶
func SafeGetManyITransientFromContainer(ctn di.Container) ([]ITransient, error)
SafeGetManyITransientFromContainer trys to get the object by type, will not panic, returns nil and error