certloader

package
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

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