Versions in this module Expand all Collapse all v1 v1.0.0 Apr 27, 2026 Changes in this version + const DefaultShutdownTimeout + var ErrCyclicDep = errors.New("helix: cyclic dependency") + var ErrNotFound = errors.New("helix: not found") + var ErrShutdownTimeout = errors.New("helix: shutdown timeout exceeded") + var ErrUnresolvable = errors.New("helix: cannot resolve component") + func ResolveAll[T any](container *Container) ([]T, error) + type ComponentRegistration struct + Component any + Lazy bool + Scope Scope + func NewComponentRegistration(component any) ComponentRegistration + type Container struct + func NewContainer(opts ...Option) *Container + func (c *Container) Register(component any) error + func (c *Container) Resolve(target any) error + func (c *Container) Shutdown() error + func (c *Container) Start() error + type CyclicDepError struct + Path []string + func (e *CyclicDepError) Error() string + func (e *CyclicDepError) Unwrap() error + type DependencyGraph struct + Edges map[string][]string + Nodes []string + type Lifecycle interface + OnStart func() error + OnStop func() error + type LifecycleCandidate struct + Instance Lifecycle + Name string + type LifecycleResolver interface + LifecycleCandidates func() ([]LifecycleCandidate, error) + type Option func(*Container) + func WithLogger(logger *slog.Logger) Option + func WithResolver(r Resolver) Option + func WithShutdownTimeout(timeout time.Duration) Option + func WithValueLookup(lookup func(key string) (any, bool)) Option + type ReflectResolver struct + func NewReflectResolver() *ReflectResolver + func (r *ReflectResolver) Graph() DependencyGraph + func (r *ReflectResolver) LifecycleCandidates() ([]LifecycleCandidate, error) + func (r *ReflectResolver) Register(component any) error + func (r *ReflectResolver) Resolve(target any) error + type Resolver interface + Graph func() DependencyGraph + Register func(component any) error + Resolve func(target any) error + type Scope string + const ScopePrototype + const ScopeSingleton + type WireResolver struct + func NewWireResolver() *WireResolver + func (r *WireResolver) Graph() DependencyGraph + func (r *WireResolver) LifecycleCandidates() ([]LifecycleCandidate, error) + func (r *WireResolver) Register(component any) error + func (r *WireResolver) Resolve(target any) error