Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidConstructor is error triggered when constructor have invalid signature. ErrInvalidConstructor = errors.New("unexpected constructor") )
View Source
var ( // ErrInvalidType is error triggered when provided invalid type. ErrInvalidType = errors.New("invalid type") )
View Source
var ( // ErrInvalidValue is error triggered when provided invalid value. ErrInvalidValue = errors.New("invalid value") )
View Source
var ErrPanicked = errors.New("panicked")
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler interface {
Create(dependencies ...*Dependency) (reflect.Value, Closer, error)
Dependencies() []*Dependency
Type() reflect.Type
}
type Constructor ¶
type Constructor struct {
// contains filtered or unexported fields
}
Constructor implements the Compiler interface.
func NewConstructor ¶
func NewConstructor(fn any) (*Constructor, error)
NewConstructor is constructor of Constructor. Argument fn may be one of:
- func New(args ...any) (value any)
- func New(args ...any) (value any, err error)
- func New(args ...any) (value any, closer func(){})
- func New(args ...any) (value any, closer func(){}, err error)
func (*Constructor) Create ¶
func (c *Constructor) Create(dependencies ...*Dependency) (_ reflect.Value, _ Closer, err error)
func (*Constructor) Dependencies ¶
func (c *Constructor) Dependencies() []*Dependency
func (*Constructor) Type ¶
func (c *Constructor) Type() reflect.Type
type Dependency ¶
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
func (*Type) Dependencies ¶
func (c *Type) Dependencies() []*Dependency
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (*Value) Dependencies ¶
func (c *Value) Dependencies() []*Dependency
Click to show internal directories.
Click to hide internal directories.