Documentation ¶
Index ¶
- Constants
- func NewReflect(i interface{}) func() reflect.Value
- type ApplicationContext
- func (t *ApplicationContext) Get(name string) interface{}
- func (t *ApplicationContext) GetBean(name string, fields Fields, args ConstructorArgs) interface{}
- func (t *ApplicationContext) GetBeanDefinition(name string) *BeanDefinition
- func (t *ApplicationContext) Has(name string) (ok bool)
- func (t *ApplicationContext) Init()
- type BeanDefinition
- type ConstructorArgs
- type Fields
- type Reference
- type ReturnError
Constants ¶
View Source
const ( PROTOTYPE = "prototype" SINGLETON = "singleton" )
依赖场景类型
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplicationContext ¶
type ApplicationContext struct { Definitions []BeanDefinition // contains filtered or unexported fields }
ApplicationContext 应用上下文
func NewApplicationContext ¶
func NewApplicationContext(definitions []BeanDefinition) *ApplicationContext
NewApplicationContext 创建应用上下文
func (*ApplicationContext) Get ¶
func (t *ApplicationContext) Get(name string) interface{}
Get 快速获取实例
func (*ApplicationContext) GetBean ¶
func (t *ApplicationContext) GetBean(name string, fields Fields, args ConstructorArgs) interface{}
GetBean 获取实例
func (*ApplicationContext) GetBeanDefinition ¶
func (t *ApplicationContext) GetBeanDefinition(name string) *BeanDefinition
GetBeanDefinition 获取依赖定义
func (*ApplicationContext) Has ¶
func (t *ApplicationContext) Has(name string) (ok bool)
Has 判断组件是否存在
type BeanDefinition ¶
type BeanDefinition struct { Name string Reflect func() reflect.Value Scope string InitMethod string ConstructorArgs ConstructorArgs Fields Fields // contains filtered or unexported fields }
BeanDefinition 依赖定义
type ReturnError ¶
type ReturnError struct {
// contains filtered or unexported fields
}
ReturnError 返回错误
Click to show internal directories.
Click to hide internal directories.