Documentation
¶
Index ¶
Constants ¶
const ( // ComponentName is the unique identifier for this component. ComponentName = "configloader" // EventBufferSize is the size of the event subscription buffer. // Size 50: Low-volume component (~1 event per config change). EventBufferSize = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigLoaderComponent ¶
type ConfigLoaderComponent struct {
// contains filtered or unexported fields
}
ConfigLoaderComponent subscribes to ConfigResourceChangedEvent and parses config data.
This component is responsible for: - Converting HAProxyTemplateConfig CRD Spec to config.Config - Publishing ConfigParsedEvent for successfully parsed configs - Logging errors for conversion failures
Architecture: This is a pure event-driven component with no knowledge of watchers or Kubernetes. It simply reacts to ConfigResourceChangedEvent and produces ConfigParsedEvent.
func NewConfigLoaderComponent ¶
func NewConfigLoaderComponent(eventBus *busevents.EventBus, logger *slog.Logger) *ConfigLoaderComponent
NewConfigLoaderComponent creates a new ConfigLoader component.
Parameters:
- eventBus: The EventBus to subscribe to and publish on
- logger: Structured logger for diagnostics
Returns:
- *ConfigLoaderComponent ready to start
func (*ConfigLoaderComponent) Start ¶
func (c *ConfigLoaderComponent) Start(ctx context.Context) error
Start begins processing events from the EventBus.
This method blocks until Stop() is called or the context is canceled. The component is already subscribed to the EventBus (subscription happens in constructor). Returns nil on graceful shutdown.
Example:
go component.Start(ctx)
func (*ConfigLoaderComponent) Stop ¶
func (c *ConfigLoaderComponent) Stop()
Stop gracefully stops the component.