transient

package
v0.1.226 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 AddScopedITransientByFuncWithMetadata added in v0.1.217

func AddScopedITransientByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedITransientByFuncWithMetadata adds a type by a custom func

func AddScopedITransientWithMetadata added in v0.1.217

func AddScopedITransientWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedITransientWithMetadata adds a type that implements ITransient

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 AddSingletonITransientByFuncWithMetadata added in v0.1.217

func AddSingletonITransientByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonITransientByFuncWithMetadata 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 AddSingletonITransientByObjWithMetadata added in v0.1.217

func AddSingletonITransientByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonITransientByObjWithMetadata adds a prebuilt obj

func AddSingletonITransientWithMetadata added in v0.1.217

func AddSingletonITransientWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonITransientWithMetadata adds a type that implements ITransient

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 AddTransientITransientByFuncWithMetadata added in v0.1.217

func AddTransientITransientByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientITransientByFuncWithMetadata adds a type by a custom func

func AddTransientITransientWithMetadata added in v0.1.217

func AddTransientITransientWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientITransientWithMetadata adds a type that implements ITransient

func GetITransientDefinition added in v0.1.217

func GetITransientDefinition(ctn di.Container) *di.Def

GetITransientDefinition returns that last definition registered that this container can provide

func GetITransientDefinitions added in v0.1.217

func GetITransientDefinitions(ctn di.Container) []*di.Def

GetITransientDefinitions returns all definitions that this container can provide

func RemoveAllITransient

func RemoveAllITransient(builder *di.Builder)

RemoveAllITransient removes all ITransient from the DI

Types

type ITransient

type ITransient interface {
	SetName(in string)
	GetName() string
}

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

Jump to

Keyboard shortcuts

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