resolving

package
v1.3.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefreshDefault = RefreshState(iota)
	RefreshPrepare
	Refreshing
	Refreshed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionContext added in v1.2.3

type ConditionContext struct {
	// contains filtered or unexported fields
}

ConditionContext provides an evaluation context for conditions during bean resolution.

func (*ConditionContext) Find added in v1.2.3

func (c *ConditionContext) Find(beanID gs.BeanID) ([]gs.ConditionBean, error)

Find returns all beans that match the provided selector and are successfully resolved (active).

func (*ConditionContext) Has added in v1.2.3

func (c *ConditionContext) Has(key string) bool

Has checks if a configuration property exists.

func (*ConditionContext) Prop added in v1.2.3

func (c *ConditionContext) Prop(key string, def ...string) string

Prop retrieves a configuration property by key, optionally returning a default value if the key is not found.

type RefreshState

type RefreshState int

RefreshState represents the current state of the container.

type Resolving

type Resolving struct {
	// contains filtered or unexported fields
}

Resolving is the core container responsible for holding bean definitions, processing modules, scanning configuration beans, and resolving beans against conditions.

func New

func New() *Resolving

New creates an empty Resolving instance.

func (*Resolving) Beans

func (c *Resolving) Beans() []*gs_bean.BeanDefinition

Beans returns all active bean definitions, excluding deleted ones.

func (*Resolving) Provide

func (c *Resolving) Provide(objOrCtor any, args ...gs.Arg) *gs_bean.BeanDefinition

Provide registers a bean definition. It accepts either an existing instance or a constructor function.

func (*Resolving) Refresh

func (c *Resolving) Refresh(p flatten.Storage) error

Refresh performs the full lifecycle of container initialization. The phases are as follows:

  1. Apply registered modules to register additional beans.
  2. Scan configuration beans and register methods as beans.
  3. Resolve conditions for all beans and mark inactive ones as deleted.
  4. Check for duplicate beans (by type and name).
  5. Validate that all root beans are resolved and ready to wire.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL