Documentation
¶
Overview ¶
Package gs_bean provides the bean definition for the Go-Spring framework.
Index ¶
- Constants
- type BeanDefinition
- func (d *BeanDefinition) Callable() gs.Callable
- func (d *BeanDefinition) SetCondition(conditions ...gs.Condition)
- func (d *BeanDefinition) SetConfiguration(param ...gs.ConfigurationParam)
- func (d *BeanDefinition) SetDependsOn(selectors ...gs.BeanSelectorInterface)
- func (d *BeanDefinition) SetDestroy(fn gs.BeanDestroyFunc)
- func (d *BeanDefinition) SetExport(exports ...reflect.Type)
- func (d *BeanDefinition) SetFileLine(file string, line int)
- func (d *BeanDefinition) SetInit(fn gs.BeanInitFunc)
- func (d *BeanDefinition) SetName(name string)
- func (d *BeanDefinition) SetRefreshable(tag string)
- func (d *BeanDefinition) Status() BeanStatus
- func (d *BeanDefinition) String() string
- func (d *BeanDefinition) TypeAndName() (reflect.Type, string)
- type BeanMetadata
- func (d *BeanMetadata) Conditions() []gs.Condition
- func (d *BeanMetadata) ConfigurationBean() bool
- func (d *BeanMetadata) ConfigurationParam() gs.ConfigurationParam
- func (d *BeanMetadata) DependsOn() []gs.BeanSelectorInterface
- func (d *BeanMetadata) Destroy() gs.BeanDestroyFunc
- func (d *BeanMetadata) Exports() []reflect.Type
- func (d *BeanMetadata) FileLine() (string, int)
- func (d *BeanMetadata) Init() gs.BeanInitFunc
- func (d *BeanMetadata) RefreshTag() string
- func (d *BeanMetadata) Refreshable() bool
- func (d *BeanMetadata) SetStatus(status BeanStatus)
- type BeanRuntime
- type BeanStatus
Constants ¶
const ( StatusDeleted = BeanStatus(-1) // Bean has been deleted. StatusDefault = BeanStatus(iota) // Default status of the bean. StatusResolving // Bean is being resolved. StatusResolved // Bean has been resolved. StatusCreating // Bean is being created. StatusCreated // Bean has been created. StatusWired // Bean has been wired. )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeanDefinition ¶
type BeanDefinition struct {
*BeanMetadata
*BeanRuntime
}
BeanDefinition contains both metadata and runtime information of a bean.
func (*BeanDefinition) Callable ¶
func (d *BeanDefinition) Callable() gs.Callable
Callable returns the callable for the bean.
func (*BeanDefinition) SetCondition ¶
func (d *BeanDefinition) SetCondition(conditions ...gs.Condition)
SetCondition adds a condition to the list of conditions for the bean.
func (*BeanDefinition) SetConfiguration ¶
func (d *BeanDefinition) SetConfiguration(param ...gs.ConfigurationParam)
SetConfiguration sets the configuration flag and parameters for the bean.
func (*BeanDefinition) SetDependsOn ¶
func (d *BeanDefinition) SetDependsOn(selectors ...gs.BeanSelectorInterface)
SetDependsOn sets the list of dependencies for the bean.
func (*BeanDefinition) SetDestroy ¶
func (d *BeanDefinition) SetDestroy(fn gs.BeanDestroyFunc)
SetDestroy sets the destruction function for the bean.
func (*BeanDefinition) SetExport ¶
func (d *BeanDefinition) SetExport(exports ...reflect.Type)
SetExport sets the exported interfaces for the bean.
func (*BeanDefinition) SetFileLine ¶
func (d *BeanDefinition) SetFileLine(file string, line int)
SetFileLine sets the file and line number for the bean.
func (*BeanDefinition) SetInit ¶
func (d *BeanDefinition) SetInit(fn gs.BeanInitFunc)
SetInit sets the initialization function for the bean.
func (*BeanDefinition) SetName ¶
func (d *BeanDefinition) SetName(name string)
SetName sets the name of the bean.
func (*BeanDefinition) SetRefreshable ¶
func (d *BeanDefinition) SetRefreshable(tag string)
SetRefreshable sets the refreshable flag and tag for the bean.
func (*BeanDefinition) Status ¶
func (d *BeanDefinition) Status() BeanStatus
Status returns the current status of the bean.
func (*BeanDefinition) String ¶
func (d *BeanDefinition) String() string
String returns a string representation of the bean.
func (*BeanDefinition) TypeAndName ¶
func (d *BeanDefinition) TypeAndName() (reflect.Type, string)
TypeAndName returns the type and name of the bean.
type BeanMetadata ¶
type BeanMetadata struct {
// contains filtered or unexported fields
}
BeanMetadata holds the metadata information of a bean.
func (*BeanMetadata) Conditions ¶
func (d *BeanMetadata) Conditions() []gs.Condition
Conditions returns the list of conditions for the bean.
func (*BeanMetadata) ConfigurationBean ¶
func (d *BeanMetadata) ConfigurationBean() bool
ConfigurationBean returns whether the bean is a configuration bean.
func (*BeanMetadata) ConfigurationParam ¶
func (d *BeanMetadata) ConfigurationParam() gs.ConfigurationParam
ConfigurationParam returns the configuration parameters for the bean.
func (*BeanMetadata) DependsOn ¶
func (d *BeanMetadata) DependsOn() []gs.BeanSelectorInterface
DependsOn returns the list of dependencies for the bean.
func (*BeanMetadata) Destroy ¶
func (d *BeanMetadata) Destroy() gs.BeanDestroyFunc
Destroy returns the destruction function of the bean.
func (*BeanMetadata) Exports ¶
func (d *BeanMetadata) Exports() []reflect.Type
Exports returns the list of exported types for the bean.
func (*BeanMetadata) FileLine ¶
func (d *BeanMetadata) FileLine() (string, int)
FileLine returns the file and line number for the bean.
func (*BeanMetadata) Init ¶
func (d *BeanMetadata) Init() gs.BeanInitFunc
Init returns the initialization function of the bean.
func (*BeanMetadata) RefreshTag ¶
func (d *BeanMetadata) RefreshTag() string
RefreshTag returns the refresh tag of the bean.
func (*BeanMetadata) Refreshable ¶
func (d *BeanMetadata) Refreshable() bool
Refreshable returns whether the bean is refreshable.
func (*BeanMetadata) SetStatus ¶
func (d *BeanMetadata) SetStatus(status BeanStatus)
SetStatus sets the current status of the bean.
type BeanRuntime ¶
type BeanRuntime struct {
// contains filtered or unexported fields
}
BeanRuntime holds runtime information about the bean.
func (*BeanRuntime) Callable ¶
func (d *BeanRuntime) Callable() gs.Callable
Callable returns the callable for the bean.
func (*BeanRuntime) Interface ¶
func (d *BeanRuntime) Interface() interface{}
Interface returns the underlying value of the bean.
func (*BeanRuntime) Status ¶
func (d *BeanRuntime) Status() BeanStatus
Status returns the current status of the bean.
func (*BeanRuntime) String ¶
func (d *BeanRuntime) String() string
String returns a string representation of the bean.
func (*BeanRuntime) Type ¶
func (d *BeanRuntime) Type() reflect.Type
Type returns the type of the bean.
func (*BeanRuntime) Value ¶
func (d *BeanRuntime) Value() reflect.Value
Value returns the value of the bean as reflect.Value.
type BeanStatus ¶
type BeanStatus int8
BeanStatus represents the different lifecycle statuses of a bean.
func (BeanStatus) String ¶
func (status BeanStatus) String() string
String returns a human-readable string of the bean status.