Documentation ¶
Index ¶
- Variables
- func AddScopedIServiceProvider(builder *di.Builder, implType reflect.Type)
- func AddScopedIServiceProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedISingletonServiceProvider(builder *di.Builder, implType reflect.Type)
- func AddScopedISingletonServiceProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIServiceProvider(builder *di.Builder, implType reflect.Type)
- func AddSingletonIServiceProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIServiceProviderByObj(builder *di.Builder, obj interface{})
- func AddSingletonISingletonServiceProvider(builder *di.Builder, implType reflect.Type)
- func AddSingletonISingletonServiceProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonServiceProviderByObj(builder *di.Builder, obj interface{})
- func AddTransientIServiceProvider(builder *di.Builder, implType reflect.Type)
- func AddTransientIServiceProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientISingletonServiceProvider(builder *di.Builder, implType reflect.Type)
- func AddTransientISingletonServiceProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func RemoveAllIServiceProvider(builder *di.Builder)
- func RemoveAllISingletonServiceProvider(builder *di.Builder)
- type IServiceProvider
- type IServiceProviderInternal
- type ISingletonServiceProvider
- type ISingletonServiceProviderInternal
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeIServiceProvider = di.GetInterfaceReflectType((*IServiceProvider)(nil))
ReflectTypeIServiceProvider used when your service claims to implement IServiceProvider
var ReflectTypeISingletonServiceProvider = di.GetInterfaceReflectType((*ISingletonServiceProvider)(nil))
ReflectTypeISingletonServiceProvider used when your service claims to implement ISingletonServiceProvider
Functions ¶
func AddScopedIServiceProvider ¶
AddScopedIServiceProvider adds a type that implements IServiceProvider
func AddScopedIServiceProviderByFunc ¶
func AddScopedIServiceProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddScopedIServiceProviderByFunc adds a type by a custom func
func AddScopedISingletonServiceProvider ¶
AddScopedISingletonServiceProvider adds a type that implements ISingletonServiceProvider
func AddScopedISingletonServiceProviderByFunc ¶
func AddScopedISingletonServiceProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddScopedISingletonServiceProviderByFunc adds a type by a custom func
func AddSingletonIServiceProvider ¶
AddSingletonIServiceProvider adds a type that implements IServiceProvider
func AddSingletonIServiceProviderByFunc ¶
func AddSingletonIServiceProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddSingletonIServiceProviderByFunc adds a type by a custom func
func AddSingletonIServiceProviderByObj ¶
AddSingletonIServiceProviderByObj adds a prebuilt obj
func AddSingletonISingletonServiceProvider ¶
AddSingletonISingletonServiceProvider adds a type that implements ISingletonServiceProvider
func AddSingletonISingletonServiceProviderByFunc ¶
func AddSingletonISingletonServiceProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddSingletonISingletonServiceProviderByFunc adds a type by a custom func
func AddSingletonISingletonServiceProviderByObj ¶
AddSingletonISingletonServiceProviderByObj adds a prebuilt obj
func AddTransientIServiceProvider ¶
AddTransientIServiceProvider adds a type that implements IServiceProvider
func AddTransientIServiceProviderByFunc ¶
func AddTransientIServiceProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddTransientIServiceProviderByFunc adds a type by a custom func
func AddTransientISingletonServiceProvider ¶
AddTransientISingletonServiceProvider adds a type that implements ISingletonServiceProvider
func AddTransientISingletonServiceProviderByFunc ¶
func AddTransientISingletonServiceProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddTransientISingletonServiceProviderByFunc adds a type by a custom func
func RemoveAllIServiceProvider ¶
RemoveAllIServiceProvider removes all IServiceProvider from the DI
func RemoveAllISingletonServiceProvider ¶
RemoveAllISingletonServiceProvider removes all ISingletonServiceProvider from the DI
Types ¶
type IServiceProvider ¶
IServiceProvider interface
func GetIServiceProviderFromContainer ¶
func GetIServiceProviderFromContainer(ctn di.Container) IServiceProvider
GetIServiceProviderFromContainer alternative to SafeGetIServiceProviderFromContainer but panics of object is not present
func SafeGetIServiceProviderFromContainer ¶
func SafeGetIServiceProviderFromContainer(ctn di.Container) (IServiceProvider, error)
SafeGetIServiceProviderFromContainer trys to get the object by type, will not panic, returns nil and error
type IServiceProviderInternal ¶
type IServiceProviderInternal interface { IServiceProvider SetContainer(di.Container) }
IServiceProviderInternal interface
type ISingletonServiceProvider ¶
ISingletonServiceProvider interface
func GetISingletonServiceProviderFromContainer ¶
func GetISingletonServiceProviderFromContainer(ctn di.Container) ISingletonServiceProvider
GetISingletonServiceProviderFromContainer alternative to SafeGetISingletonServiceProviderFromContainer but panics of object is not present
func SafeGetISingletonServiceProviderFromContainer ¶
func SafeGetISingletonServiceProviderFromContainer(ctn di.Container) (ISingletonServiceProvider, error)
SafeGetISingletonServiceProviderFromContainer trys to get the object by type, will not panic, returns nil and error
type ISingletonServiceProviderInternal ¶
type ISingletonServiceProviderInternal interface { ISingletonServiceProvider SetContainer(di.Container) }
ISingletonServiceProviderInternal interface