Documentation
¶
Index ¶
Constants ¶
const ( // ComponentName is the unique identifier for this component. ComponentName = "certloader" // EventBufferSize is the size of the event subscription buffer. // Size 50: Low-volume component (~1 event per certificate change). EventBufferSize = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertLoaderComponent ¶
type CertLoaderComponent struct {
// contains filtered or unexported fields
}
CertLoaderComponent subscribes to CertResourceChangedEvent and extracts TLS certificate data.
This component is responsible for: - Extracting TLS certificate data from Secret resources - Validating certificate keys exist (tls.crt, tls.key) - Publishing CertParsedEvent for successfully extracted certificates - Logging errors for invalid or missing certificate data
Architecture: This is a pure event-driven component with no knowledge of watchers or Kubernetes. It simply reacts to CertResourceChangedEvent and produces CertParsedEvent.
func NewCertLoaderComponent ¶
func NewCertLoaderComponent(eventBus *busevents.EventBus, logger *slog.Logger) *CertLoaderComponent
NewCertLoaderComponent creates a new CertLoader component.
Parameters:
- eventBus: The EventBus to subscribe to and publish on
- logger: Structured logger for diagnostics
Returns:
- *CertLoaderComponent ready to start
func (*CertLoaderComponent) Start ¶
func (c *CertLoaderComponent) 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 (*CertLoaderComponent) Stop ¶
func (c *CertLoaderComponent) Stop()
Stop gracefully stops the component.