Documentation
¶
Overview ¶
Package starter provides auto-configuration modules (web, data, security, observability) for the Helix framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidStarter = errors.New("invalid starter")
ErrInvalidStarter is returned when a starter Entry fails validation.
Functions ¶
func Configure ¶
Configure evaluates and activates each starter in canonical order. Validation errors are returned before any Configure call is made.
func ConfigureMarkerAware ¶
ConfigureMarkerAware evaluates and activates marker-aware starters after application components have been registered in the container. It only processes starters that implement MarkerAwareStarter; others are skipped.
Types ¶
type ActivationReason ¶
type ActivationReason string
ActivationReason describes why a starter was activated.
const ( // ReasonGoMod indicates the starter was activated because a dependency was // found in go.mod. ReasonGoMod ActivationReason = "go-mod" // ReasonConfigKey indicates the starter was activated because a matching // configuration key was present. ReasonConfigKey ActivationReason = "config-key" // ReasonComponentMarker indicates the starter was activated because a // component with the expected marker was found in the container. ReasonComponentMarker ActivationReason = "component-marker" // ReasonExplicit indicates the starter was activated because it was // explicitly enabled via configuration. ReasonExplicit ActivationReason = "explicit" )
type MarkerAwareStarter ¶
type MarkerAwareStarter interface {
Starter
ConditionFromContainer(container *core.Container) bool
}
MarkerAwareStarter is an optional extension of Starter. Starters that implement it can evaluate their activation condition after application components have been registered in the container.
Priority of evaluation (highest to lowest):
- enabled: false in config → never active
- enabled: true in config → always active
- ConditionFromContainer → active if container holds the expected marker
- Condition → default structural detection (go.mod, config key)
type Option ¶
type Option func(*options)
Option configures the starter orchestrator.
func WithLogger ¶
WithLogger sets the logger used to emit activation events.
type Starter ¶
type Starter interface {
// Condition reports whether this starter should be activated.
Condition() bool
// Configure registers components into the DI container.
// It returns an error if configuration fails — for example when a required
// dependency is missing or a component cannot be registered.
Configure(*core.Container) error
}
Starter is the contract that auto-configuration modules must implement.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
starterutil
Package starterutil provides shared helpers for Helix starters.
|
Package starterutil provides shared helpers for Helix starters. |