gs_core

package
v1.3.0-rc Latest Latest
Warning

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

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

Documentation

Overview

Package gs_core provides the core implementation of the Inversion of Control (IoC) container used by the Go-Spring framework.

The container manages the full lifecycle of application beans, including:

  1. Resolving phase: Bean definitions are registered, configuration beans are scanned, conditions are evaluated, and inactive beans are filtered out.

  2. Injecting phase: Dependencies are resolved and injected, and the final bean graph is constructed starting from the specified root beans.

The resolving phase metadata is discarded after the container is fully refreshed to reduce memory usage.

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	*resolving.Resolving
	*injecting.Injecting
	State RefreshState
}

Container represents the core IoC container of the Go-Spring framework.

func New

func New() *Container

New creates and returns a new IoC container instance.

func (*Container) Refresh

func (c *Container) Refresh(p flatten.Storage, roots []*gs_bean.BeanDefinition) error

Refresh initializes the container and performs the full lifecycle startup.

Parameters:

  • p: configuration storage used for property resolution.
  • roots: the root bean definitions that act as entry points for dependency injection.

Refresh should only be called once for a container instance. After a successful refresh, resolving metadata is discarded and the container transitions to the Refreshed state.

type RefreshState added in v1.3.0

type RefreshState int

RefreshState represents the lifecycle state of the container.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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