scoped

package
v0.1.322 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeIScoped = di.GetInterfaceReflectType((*IScoped)(nil))

ReflectTypeIScoped used when your service claims to implement IScoped

Functions

func AddScopedIScoped

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

AddScopedIScoped adds a type that implements IScoped

func AddScopedIScopedByFunc

func AddScopedIScopedByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddScopedIScopedByFunc adds a type by a custom func

func AddScopedIScopedByFuncWithMetadata added in v0.1.217

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

AddScopedIScopedByFuncWithMetadata adds a type by a custom func

func AddScopedIScopedWithMetadata added in v0.1.217

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

AddScopedIScopedWithMetadata adds a type that implements IScoped

func AddSingletonIScoped

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

AddSingletonIScoped adds a type that implements IScoped

func AddSingletonIScopedByFunc

func AddSingletonIScopedByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddSingletonIScopedByFunc adds a type by a custom func

func AddSingletonIScopedByFuncWithMetadata added in v0.1.217

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

AddSingletonIScopedByFuncWithMetadata adds a type by a custom func

func AddSingletonIScopedByObj

func AddSingletonIScopedByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)

AddSingletonIScopedByObj adds a prebuilt obj

func AddSingletonIScopedByObjWithMetadata added in v0.1.217

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

AddSingletonIScopedByObjWithMetadata adds a prebuilt obj

func AddSingletonIScopedWithMetadata added in v0.1.217

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

AddSingletonIScopedWithMetadata adds a type that implements IScoped

func AddTransientIScoped

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

AddTransientIScoped adds a type that implements IScoped

func AddTransientIScopedByFunc

func AddTransientIScopedByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddTransientIScopedByFunc adds a type by a custom func

func AddTransientIScopedByFuncWithMetadata added in v0.1.217

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

AddTransientIScopedByFuncWithMetadata adds a type by a custom func

func AddTransientIScopedWithMetadata added in v0.1.217

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

AddTransientIScopedWithMetadata adds a type that implements IScoped

func GetIScopedDefinition added in v0.1.217

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

GetIScopedDefinition returns that last definition registered that this container can provide

func GetIScopedDefinitions added in v0.1.217

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

GetIScopedDefinitions returns all definitions that this container can provide

func RemoveAllIScoped

func RemoveAllIScoped(builder *di.Builder)

RemoveAllIScoped removes all IScoped from the DI

Types

type IScoped

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

IScoped ...

func GetIScopedFromContainer

func GetIScopedFromContainer(ctn di.Container) IScoped

GetIScopedFromContainer alternative to SafeGetIScopedFromContainer but panics of object is not present

func GetManyIScopedFromContainer

func GetManyIScopedFromContainer(ctn di.Container) []IScoped

GetManyIScopedFromContainer alternative to SafeGetManyIScopedFromContainer but panics of object is not present

func SafeGetIScopedFromContainer

func SafeGetIScopedFromContainer(ctn di.Container) (IScoped, error)

SafeGetIScopedFromContainer trys to get the object by type, will not panic, returns nil and error

func SafeGetManyIScopedFromContainer

func SafeGetManyIScopedFromContainer(ctn di.Container) ([]IScoped, error)

SafeGetManyIScopedFromContainer 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