Versions in this module Expand all Collapse all v1 v1.0.1 Mar 31, 2023 v1.0.0 Feb 19, 2023 Changes in this version + var ErrDoesNotExist = errors.New("does not exist") + var ErrInvalidConstructor = compiler.ErrInvalidConstructor + var ErrInvalidType = compiler.ErrInvalidType + var ErrInvalidValue = compiler.ErrInvalidValue + var ErrIsNil = errors.New("is nil") + var ErrMultipleDefinitions = errors.New("multiple definitions") + var ErrMustBeSliceOrPointer = errors.New("must be a slice or pointer") + var ErrNotImplementInterface = errors.New("not implement interface") + var ErrNotPointerToInterface = errors.New("not pointer to interface") + var ErrorMustBeFunction = errors.New("must be a function") + func NewTypeError(typ reflect.Type, err error) error + type AddOption interface + func AddOptions(options ...AddOption) AddOption + type Arg struct + Key string + Value string + type Args []Arg + type AsOption interface + func As(aliases ...any) AsOption + type Builder interface + Add func(value Value, options ...AddOption) error + Apply func(options ...BuilderOption) error + Autowire func(target Type, options ...ProvideOption) error + Build func() (Container, error) + Definitions func() []Definition + Provide func(constructor Constructor, options ...ProvideOption) error + func NewBuilder(options ...BuilderOption) (_ Builder, err error) + type BuilderOption interface + func Add(value Value, options ...AddOption) BuilderOption + func Autowire(value Type, options ...ProvideOption) BuilderOption + func BuilderOptions(options ...BuilderOption) BuilderOption + func Provide(value Constructor, options ...ProvideOption) BuilderOption + type ConstraintOption interface + func Constraint(key any, restrictions ...Restriction) ConstraintOption + type Constructor any + type Container interface + Call func(fn Function, options ...ConstraintOption) (err error) + Close func() error + Has func(value Type, modifiers ...Modifier) (exist bool) + Resolve func(target Value, modifiers ...Modifier) (err error) + type Definition interface + Dependencies func() []Dependency + ID func() int + Tags func() Tags + Type func() reflect.Type + Unshared func() bool + type Dependency struct + Definitions []Definition + Optional bool + Type reflect.Type + type Function any + type Modifier func(defs []Definition) []Definition + func Filter(match func(def Definition) bool) Modifier + func Sort(less func(a, b Definition) bool) Modifier + func WithTags(tags ...string) Modifier + func WithoutTags(tags ...string) Modifier + type ProvideOption interface + func ProvideOptions(options ...ProvideOption) ProvideOption + func Unshared() ProvideOption + type Restriction interface + func Optional(v bool) Restriction + type Tag struct + Args Args + Name string + type Tags []Tag + type Type any + type TypeError struct + Err error + Type reflect.Type + func (e *TypeError) Error() string + func (e *TypeError) Unwrap() error + type Value any