Documentation ¶
Index ¶
- Variables
- func GenericAdd[T any](c Container, qualifier string, injector Injector[T])
- func GenericAddVal[T any](c Container, qualifier string, instance T)
- func GenericGet[T any](c Container, ctx context.Context, qualifier string) (T, error)
- func GenericGetAll[T any](c Container, ctx context.Context, qualifier string) ([]T, error)
- func GenericGetLast[T any](c Container, ctx context.Context, qualifier string) (T, error)deprecated
- func GetAll[T any](ctx context.Context, qualifier string) ([]T, error)
- func GetLast[T any](ctx context.Context, qualifier string) (T, error)
- func Qualifier(name string) qualifier
- func Register[T any](qualifier string, injector Injector[T])
- func RegisterInstance[T any](qualifier string, instance T)
- func RegisterInstances[T any](qualifier string, instances []T)
- func Release()
- func Reset()
- type Container
- type Injector
- type Resolver
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInverseNilContext = errors.New("container received nil context") ErrInverseResolveLoop = errors.New("container dependency loop") ErrInverseResolverMissing = errors.New("container does not contain qualifier") ErrInverseResolveError = errors.New("container failed to resolve qualifier") ErrInverseCastError = errors.New("container value cast error") )
View Source
var Global = NewContainer()
Functions ¶
func GenericAdd ¶ added in v0.0.29
func GenericAddVal ¶ added in v0.0.29
func GenericGet ¶ added in v0.0.29
func GenericGetAll ¶ added in v0.0.29
func RegisterInstance ¶ added in v0.0.15
func RegisterInstances ¶ added in v0.0.15
Types ¶
type Container ¶ added in v0.0.29
type Container interface { Reset() Clear() Invalid(error) Valid() bool Error() error Add(q string, r Resolver) AddVal(q string, v any) Get(ctx context.Context, q string) (any, error) GetAll(ctx context.Context, q string) ([]any, error) }
func NewContainer ¶ added in v0.0.29
func NewContainer() Container
Click to show internal directories.
Click to hide internal directories.