Versions in this module Expand all Collapse all v1 v1.1.0 Nov 7, 2026 v1.0.0 Nov 7, 2026 Changes in this version + var ErrClosed = errors.New("di: container is closed") + var ErrCycle = errors.New("di: dependency cycle") + var ErrNotProvided = errors.New("di: no provider registered") + func Has[T any](c *Container) bool + func Invoke(c *Container, fn func(*Scope) error) error + func MustProvideNamed[T any](c *Container, name string, ctor Constructor[T]) + func MustProvide[T any](c *Container, ctor Constructor[T]) + func MustResolveNamed[T any](r Resolver, name string) T + func MustResolve[T any](r Resolver) T + func MustSupply[T any](c *Container, v T) + func ProvideNamed[T any](c *Container, name string, ctor Constructor[T]) error + func Provide[T any](c *Container, ctor Constructor[T]) error + func ResolveNamed[T any](r Resolver, name string) (T, error) + func Resolve[T any](r Resolver) (T, error) + func SupplyNamed[T any](c *Container, name string, v T) error + func Supply[T any](c *Container, v T) error + type Closer interface + Close func(ctx context.Context) error + type Constructor func(*Scope) (T, error) + type Container struct + func New() *Container + func (c *Container) Close(ctx context.Context) error + func (c *Container) Eager() error + func (c *Container) Providers() []string + type Resolver interface + type Scope struct + func NewScope(c *Container) *Scope + func (s *Scope) Container() *Container