serviceprovider

package
v0.1.183 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeIServiceProvider = di.GetInterfaceReflectType((*IServiceProvider)(nil))

ReflectTypeIServiceProvider used when your service claims to implement IServiceProvider

View Source
var ReflectTypeISingletonServiceProvider = di.GetInterfaceReflectType((*ISingletonServiceProvider)(nil))

ReflectTypeISingletonServiceProvider used when your service claims to implement ISingletonServiceProvider

Functions

func AddScopedIServiceProvider

func AddScopedIServiceProvider(builder *di.Builder, implType reflect.Type)

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

func AddScopedISingletonServiceProvider(builder *di.Builder, implType reflect.Type)

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

func AddSingletonIServiceProvider(builder *di.Builder, implType reflect.Type)

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

func AddSingletonIServiceProviderByObj(builder *di.Builder, obj interface{})

AddSingletonIServiceProviderByObj adds a prebuilt obj

func AddSingletonISingletonServiceProvider

func AddSingletonISingletonServiceProvider(builder *di.Builder, implType reflect.Type)

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

func AddSingletonISingletonServiceProviderByObj(builder *di.Builder, obj interface{})

AddSingletonISingletonServiceProviderByObj adds a prebuilt obj

func AddTransientIServiceProvider

func AddTransientIServiceProvider(builder *di.Builder, implType reflect.Type)

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

func AddTransientISingletonServiceProvider(builder *di.Builder, implType reflect.Type)

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

func RemoveAllIServiceProvider(builder *di.Builder)

RemoveAllIServiceProvider removes all IServiceProvider from the DI

func RemoveAllISingletonServiceProvider

func RemoveAllISingletonServiceProvider(builder *di.Builder)

RemoveAllISingletonServiceProvider removes all ISingletonServiceProvider from the DI

Types

type IServiceProvider

type IServiceProvider interface {
	GetContainer() di.Container
}

IServiceProvider interface

func GetIServiceProviderFromContainer

func GetIServiceProviderFromContainer(ctn di.Container) IServiceProvider

GetIServiceProviderFromContainer alternative to SafeGetIServiceProviderFromContainer but panics of object is not present

func GetManyIServiceProviderFromContainer added in v0.1.178

func GetManyIServiceProviderFromContainer(ctn di.Container) []IServiceProvider

GetManyIServiceProviderFromContainer alternative to SafeGetManyIServiceProviderFromContainer 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

func SafeGetManyIServiceProviderFromContainer added in v0.1.178

func SafeGetManyIServiceProviderFromContainer(ctn di.Container) ([]IServiceProvider, error)

SafeGetManyIServiceProviderFromContainer 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

type ISingletonServiceProvider interface {
	GetContainer() di.Container
}

ISingletonServiceProvider interface

func GetISingletonServiceProviderFromContainer

func GetISingletonServiceProviderFromContainer(ctn di.Container) ISingletonServiceProvider

GetISingletonServiceProviderFromContainer alternative to SafeGetISingletonServiceProviderFromContainer but panics of object is not present

func GetManyISingletonServiceProviderFromContainer added in v0.1.178

func GetManyISingletonServiceProviderFromContainer(ctn di.Container) []ISingletonServiceProvider

GetManyISingletonServiceProviderFromContainer alternative to SafeGetManyISingletonServiceProviderFromContainer 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

func SafeGetManyISingletonServiceProviderFromContainer added in v0.1.178

func SafeGetManyISingletonServiceProviderFromContainer(ctn di.Container) ([]ISingletonServiceProvider, error)

SafeGetManyISingletonServiceProviderFromContainer 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL