resolving

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 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 condition evaluation context during resolution.

func (*ConditionContext) Find added in v1.2.3

Find returns beans matching the selector after resolving their conditions.

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 with optional default value.

type Module added in v1.2.3

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

Module represents a module registered in the container.

type RefreshState

type RefreshState int

RefreshState represents the current state of the container.

type Resolving

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

Resolving manages bean definitions, mocks, and dynamic bean registration functions.

func New

func New() *Resolving

New creates an empty Resolving instance.

func (*Resolving) AddMock

func (c *Resolving) AddMock(mock gs.BeanMock)

AddMock adds a mock bean to the container.

func (*Resolving) Beans

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

Beans returns all active bean definitions, excluding deleted ones.

func (*Resolving) Module added in v1.2.3

func (c *Resolving) Module(conditions []gs_cond.ConditionOnProperty, fn func(p conf.Properties) error)

Module registers a module into the container.

func (*Resolving) Object

func (c *Resolving) Object(i any) *gs.RegisteredBean

Object registers a pre-constructed instance as a bean.

func (*Resolving) Provide

func (c *Resolving) Provide(ctor any, args ...gs.Arg) *gs.RegisteredBean

Provide registers a constructor function to create a bean.

func (*Resolving) Refresh

func (c *Resolving) Refresh(p conf.Properties) error

Refresh performs the full initialization process of the container. It transitions through several phases: - Executes group functions to register additional beans. - Scans configuration beans and registers their methods as beans. - Applies mock beans to override specific targets. - Resolves all beans based on their conditions. - Validates that no duplicate beans exist.

func (*Resolving) Register

func (c *Resolving) Register(b *gs.BeanDefinition) *gs.RegisteredBean

Register adds a bean definition to the container.

func (*Resolving) RootBean added in v1.2.3

func (c *Resolving) RootBean(b *gs.RegisteredBean)

RootBean adds a root bean to the container.

func (*Resolving) Roots added in v1.2.3

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

Roots returns all root beans.

Jump to

Keyboard shortcuts

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