Documentation
¶
Index ¶
- Variables
- type ConditionInjectionFunc
- type Container
- func (c *Container) Bind(abs, instance interface{}, singleton bool)
- func (c *Container) BindFunc(abs interface{}, register InstanceRegister, singleton bool)
- func (c *Container) Bound(abs interface{}) bool
- func (c *Container) GetRegisters() map[string]InstanceRegister
- func (c *Container) Init()
- func (c *Container) InjectionCondition(f ConditionInjectionFunc, i InjectionFunc) *Container
- func (c *Container) InjectionRequire(requireAbs interface{}, i InjectionFunc) *Container
- func (c *Container) InjectionWith(i InjectionFunc) *Container
- func (c *Container) Instance(abs interface{}, params ...interface{}) (reflect.Value, error)
- func (c *Container) InstanceFor(abs interface{}, out interface{}, params ...interface{}) error
- func (c *Container) Invoke(f interface{}, params ...interface{}) ([]reflect.Value, error)
- func (c *Container) IsSingleton(abs interface{}) bool
- func (c *Container) MethodCall(abs interface{}, method string, params ...interface{}) ([]reflect.Value, error)
- func (c *Container) Register(instance interface{}, singleton bool)
- func (c *Container) RegisterSingleton(instance interface{})
- func (c *Container) Singleton(abs interface{}, instance interface{})
- func (c *Container) WithInjector(h Injector) *Container
- type FieldTag
- type InjectionFunc
- type Injector
- type InstanceRegister
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CacheTags map[string]FieldTag
)
Functions ¶
This section is empty.
Types ¶
type ConditionInjectionFunc ¶ added in v0.0.2
type ConditionInjectionFunc func(abs interface{}) bool
ConditionInjectionFunc conditional injection function
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) BindFunc ¶
func (c *Container) BindFunc(abs interface{}, register InstanceRegister, singleton bool)
func (*Container) GetRegisters ¶
func (c *Container) GetRegisters() map[string]InstanceRegister
func (*Container) InjectionCondition ¶ added in v0.0.2
func (c *Container) InjectionCondition(f ConditionInjectionFunc, i InjectionFunc) *Container
func (*Container) InjectionRequire ¶ added in v0.0.2
func (c *Container) InjectionRequire(requireAbs interface{}, i InjectionFunc) *Container
func (*Container) InjectionWith ¶ added in v0.0.2
func (c *Container) InjectionWith(i InjectionFunc) *Container
func (*Container) InstanceFor ¶ added in v0.0.2
func (*Container) IsSingleton ¶
func (*Container) MethodCall ¶
func (*Container) RegisterSingleton ¶
func (c *Container) RegisterSingleton(instance interface{})
func (*Container) WithInjector ¶ added in v0.0.2
type InjectionFunc ¶ added in v0.0.2
InjectionFunc injection function
type Injector ¶ added in v0.0.2
type Injector interface { Injection(abs interface{}, last reflect.Value) (reflect.Value, error) When(abs interface{}) bool }
Injector interface for conditional initializer
type InstanceRegister ¶
InstanceRegister register instance for container
Click to show internal directories.
Click to hide internal directories.