container

package
v0.1.249 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeContainerAccessor = reflect.TypeOf(ContainerAccessor(nil))

ReflectTypeContainerAccessor used when your service claims to implement ContainerAccessor

Functions

func AddContainerAccessorFunc

func AddContainerAccessorFunc(builder *di.Builder, fnc ContainerAccessor)

AddSingletonContainerAccessorFunc adds a func to the DI

func RemoveAllContainerAccessorFunc

func RemoveAllContainerAccessorFunc(builder *di.Builder)

RemoveAllContainerAccessorFunc removes all ContainerAccessor functions from the DI

Types

type ContainerAccessor

type ContainerAccessor func() di.Container

func GetContainerAccessorFromContainer

func GetContainerAccessorFromContainer(ctn di.Container) ContainerAccessor

GetContainerAccessorFromContainer alternative to SafeGetContainerAccessorFromContainer but panics of object is not present

func GetManyContainerAccessorFromContainer

func GetManyContainerAccessorFromContainer(ctn di.Container) []ContainerAccessor

GetManyContainerAccessorFromContainer alternative to SafeGetManyContainerAccessorFromContainer but panics of object is not present

func SafeGetContainerAccessorFromContainer

func SafeGetContainerAccessorFromContainer(ctn di.Container) (ContainerAccessor, error)

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

func SafeGetManyContainerAccessorFromContainer

func SafeGetManyContainerAccessorFromContainer(ctn di.Container) ([]ContainerAccessor, error)

SafeGetManyContainerAccessorFromContainer 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