engine

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReservedPrefix = component.ReservedPrefix

	PriorityFramework      = component.PriorityFramework
	PriorityInfrastructure = component.PriorityInfrastructure
	PriorityDefault        = component.PriorityDefault
	PriorityImportant      = component.PriorityImportant
	PriorityCritical       = component.PriorityCritical
)

Variables

This section is empty.

Functions

func AsConfig

func AsConfig[T any](h component.Handle) (*T, error)

AsConfig extracts and asserts the configuration from a handle.

func BindConfig

func BindConfig[T any](h component.Handle, target *T) error

BindConfig is a convenience function that applies the configuration from a handle to a target pointer. Discouraged: Use comp.AsConfig[T](h) instead for more idiomatic Go code.

func Get

func Get[T any](ctx context.Context, l component.Locator, name string) (T, error)

Get retrieves a component by name from a locator and asserts its type. Deprecated: Use comp.Get instead to avoid unnecessary dependencies.

func GetDefault

func GetDefault[T any](ctx context.Context, l component.Locator) (T, error)

GetDefault retrieves the default component from a locator and asserts its type. Deprecated: Use comp.GetDefault instead.

func Iter

func Iter[T any](ctx context.Context, l component.Locator) iter.Seq2[string, T]

Iter returns a type-safe iterator for components in a locator.

func Register

func Register(cat Category, p Provider, opts ...RegisterOption)

Register adds a component registration to the global pool.

Types

type Category

type Category = component.Category

type ConfigEntry

type ConfigEntry = component.ConfigEntry

type ConfigResolver

type ConfigResolver = component.ConfigResolver

type Container

type Container = component.Container

func NewContainer

func NewContainer(opts ...RegistryOption) Container

NewContainer creates a new engine container based on provided options.

type Handle

type Handle = component.Handle

type InOption

type InOption = component.InOption

func WithInScope

func WithInScope(s Scope) InOption

WithInScope specifies the perspective scope.

func WithInTags

func WithInTags(tags ...string) InOption

WithInTags specifies the perspective tags.

type LoadOption

type LoadOption = component.LoadOption

func ForCategory

func ForCategory(cat Category) LoadOption

func ForName

func ForName(name string) LoadOption

func ForScope

func ForScope(s Scope) LoadOption

func WithLoadResolver

func WithLoadResolver(res ConfigResolver) LoadOption

type LoadOptions

type LoadOptions = component.LoadOptions

type Locator

type Locator = component.Locator

type ModuleConfig

type ModuleConfig = component.ModuleConfig

type Option

type Option = container.Option

type Priority

type Priority = component.Priority

type Provider

type Provider = component.Provider

type RegisterOption

type RegisterOption = component.RegisterOption

func WithConfigResolverOption

func WithConfigResolverOption(res ConfigResolver) RegisterOption

WithConfigResolverOption specifies a local configuration resolver for a component.

func WithDefaultEntries

func WithDefaultEntries(names ...string) RegisterOption

func WithPriority

func WithPriority(p Priority) RegisterOption

func WithRequirementResolverOption

func WithRequirementResolverOption(res RequirementResolver) RegisterOption

WithRequirementResolverOption specifies a local requirement resolver for a component.

func WithScopes

func WithScopes(ss ...Scope) RegisterOption

func WithTag

func WithTag(tag string) RegisterOption

type Registration

type Registration = component.Registration

func GlobalRegistrations

func GlobalRegistrations() []Registration

GlobalRegistrations returns a copy of all registrations in the global pool.

type RegistrationOptions

type RegistrationOptions = component.RegistrationOptions

type Registry

type Registry = component.Registry

type RegistryOption

type RegistryOption func(*RegistryOptions)

func WithCategoryResolvers

func WithCategoryResolvers(res map[Category]ConfigResolver) RegistryOption

WithCategoryResolvers sets the default resolvers for specific categories.

func WithGlobalRegistrations

func WithGlobalRegistrations() RegistryOption

WithGlobalRegistrations instructs the container to load all registrations from the global pool.

type RegistryOptions

type RegistryOptions struct {
	CategoryResolvers map[Category]ConfigResolver
	Registrations     []Registration
}

type RequirementResolver

type RequirementResolver = component.RequirementResolver

type Scope

type Scope = component.Scope

Directories

Path Synopsis
Package context contains generated code by adptool.
Package context contains generated code by adptool.

Jump to

Keyboard shortcuts

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