Documentation
¶
Index ¶
- Constants
- func AsConfig[T any](h component.Handle) (*T, error)
- func BindConfig[T any](h component.Handle, target *T) error
- func Get[T any](ctx context.Context, l component.Locator, name string) (T, error)
- func GetDefault[T any](ctx context.Context, l component.Locator) (T, error)
- func Iter[T any](ctx context.Context, l component.Locator) iter.Seq2[string, T]
- func Register(cat Category, p Provider, opts ...RegisterOption)
- type Category
- type ConfigEntry
- type ConfigResolver
- type Container
- type Handle
- type InOption
- type LoadOption
- type LoadOptions
- type Locator
- type ModuleConfig
- type Option
- type Priority
- type Provider
- type RegisterOption
- func WithConfigResolverOption(res ConfigResolver) RegisterOption
- func WithDefaultEntries(names ...string) RegisterOption
- func WithPriority(p Priority) RegisterOption
- func WithRequirementResolverOption(res RequirementResolver) RegisterOption
- func WithScopes(ss ...Scope) RegisterOption
- func WithTag(tag string) RegisterOption
- type Registration
- type RegistrationOptions
- type Registry
- type RegistryOption
- type RegistryOptions
- type RequirementResolver
- type Scope
Constants ¶
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 BindConfig ¶
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 ¶
Get retrieves a component by name from a locator and asserts its type. Deprecated: Use comp.Get instead to avoid unnecessary dependencies.
func GetDefault ¶
GetDefault retrieves the default component from a locator and asserts its type. Deprecated: Use comp.GetDefault instead.
func Register ¶
func Register(cat Category, p Provider, opts ...RegisterOption)
Register adds a component registration to the global pool.
Types ¶
type ConfigEntry ¶
type ConfigEntry = component.ConfigEntry
type ConfigResolver ¶
type ConfigResolver = component.ConfigResolver
type Container ¶
func NewContainer ¶
func NewContainer(opts ...RegistryOption) Container
NewContainer creates a new engine container based on provided options.
type InOption ¶
func WithInTags ¶
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 ModuleConfig ¶
type ModuleConfig = component.ModuleConfig
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 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