Documentation
¶
Overview ¶
Package inject is a simple implementation of injection Once it is mature, it should probably be carved out into its own library
Index ¶
- type BindPartial
- type Binder
- func (self *Binder) AddDefaultBinding(t reflect.Type)
- func (self *Binder) AddDefaultBindingByPointer(p interface{})
- func (self *Binder) AddProvider(fn interface{})
- func (self *Binder) AddSingleton(obj interface{})
- func (self *Binder) Bind(prototype interface{}) BindPartial
- func (self *Binder) BindType(t reflect.Type) BindPartial
- func (self *Binder) CreateInjector() Injector
- func (self *Binder) Get(t reflect.Type) (interface{}, error)
- type BinderInjector
- type Binding
- type DefaultBinding
- type FunctionBinding
- type Injector
- type SingletonBinding
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindPartial ¶
type BindPartial struct {
// contains filtered or unexported fields
}
func (BindPartial) ToInstance ¶
func (self BindPartial) ToInstance(instance interface{})
type Binder ¶
type Binder struct {
// contains filtered or unexported fields
}
func (*Binder) AddDefaultBinding ¶
func (*Binder) AddDefaultBindingByPointer ¶
func (self *Binder) AddDefaultBindingByPointer(p interface{})
func (*Binder) AddProvider ¶
func (self *Binder) AddProvider(fn interface{})
func (*Binder) AddSingleton ¶
func (self *Binder) AddSingleton(obj interface{})
func (*Binder) Bind ¶
func (self *Binder) Bind(prototype interface{}) BindPartial
func (*Binder) CreateInjector ¶
type BinderInjector ¶
type BinderInjector struct {
// contains filtered or unexported fields
}
func (*BinderInjector) Inject ¶
func (self *BinderInjector) Inject(p interface{}) error
type DefaultBinding ¶
type DefaultBinding struct {
// contains filtered or unexported fields
}
func NewDefaultBinding ¶
func NewDefaultBinding(t reflect.Type) *DefaultBinding
func (*DefaultBinding) Get ¶
func (self *DefaultBinding) Get() (interface{}, error)
type FunctionBinding ¶
type FunctionBinding struct {
// contains filtered or unexported fields
}
func (*FunctionBinding) Get ¶
func (self *FunctionBinding) Get() (interface{}, error)
type SingletonBinding ¶
type SingletonBinding struct {
// contains filtered or unexported fields
}
func (*SingletonBinding) Get ¶
func (self *SingletonBinding) Get() (interface{}, error)
Click to show internal directories.
Click to hide internal directories.