Documentation
¶
Index ¶
- Constants
- type ArgContext
- func (a *ArgContext) Bind(v reflect.Value, tag string) error
- func (a *ArgContext) Check(c gs.Condition) (bool, error)
- func (a *ArgContext) Find(s gs.BeanSelector) ([]gs.CondBean, error)
- func (a *ArgContext) Has(key string) bool
- func (a *ArgContext) Prop(key string, def ...string) string
- func (a *ArgContext) Wire(v reflect.Value, tag string) error
- type BeanRuntime
- type Injecting
- type Injector
- type LazyField
- type Stack
- type WireTag
Constants ¶
const ( RefreshDefault = refreshState(iota) // Not refreshed yet Refreshing // Currently refreshing Refreshed // Successfully refreshed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgContext ¶
type ArgContext struct {
// contains filtered or unexported fields
}
ArgContext provides injection context for factory callables, exposing property access and bean lookup.
func NewArgContext ¶
func NewArgContext(c *Injector, stack *Stack) *ArgContext
NewArgContext constructs a new ArgContext for a wiring operation.
func (*ArgContext) Bind ¶
func (a *ArgContext) Bind(v reflect.Value, tag string) error
Bind binds a configuration property to a reflect.Value based on struct tag.
func (*ArgContext) Check ¶
func (a *ArgContext) Check(c gs.Condition) (bool, error)
Check evaluates whether a condition matches in the current context.
func (*ArgContext) Find ¶
func (a *ArgContext) Find(s gs.BeanSelector) ([]gs.CondBean, error)
Find returns beans satisfying a selector, as conditional beans.
func (*ArgContext) Has ¶
func (a *ArgContext) Has(key string) bool
Has checks whether a configuration key is present.
func (*ArgContext) Prop ¶
func (a *ArgContext) Prop(key string, def ...string) string
Prop retrieves a property value, with optional default.
func (*ArgContext) Wire ¶
func (a *ArgContext) Wire(v reflect.Value, tag string) error
Wire performs autowiring on a reflect.Value, using the given tag.
type BeanRuntime ¶
type BeanRuntime interface { Name() string // The name of the bean Type() reflect.Type // The type of the bean Value() reflect.Value // The value of the bean Interface() any // The Underlying value Callable() *gs_arg.Callable // Constructor, if any Status() gs_bean.BeanStatus // Lifecycle status String() string // String representation }
BeanRuntime defines an interface for runtime bean information.
type Injecting ¶
type Injecting struct {
// contains filtered or unexported fields
}
Injecting defines a bean injection container.
func (*Injecting) Close ¶
func (c *Injecting) Close()
Close closes the container and cleans up resources.
func (*Injecting) Refresh ¶
func (c *Injecting) Refresh(beans []*gs_bean.BeanDefinition) (err error)
Refresh loads and wires all provided bean definitions.
func (*Injecting) RefreshProperties ¶
func (c *Injecting) RefreshProperties(p conf.Properties) error
RefreshProperties refreshes the properties of the container.
type Injector ¶
type Injector struct {
// contains filtered or unexported fields
}
Injector handles the core autowiring and bean creation logic.
type LazyField ¶
type LazyField struct {
// contains filtered or unexported fields
}
LazyField represents a lazy-injected field with metadata.