bootstrap

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractLogger

type ContractLogger struct {
	// contains filtered or unexported fields
}

ContractLogger emits structured bootstrap events that satisfy the Stage guard.

func NewContractLogger

func NewContractLogger(log logr.Logger, component string) ContractLogger

NewContractLogger creates a logger for the given component.

func (ContractLogger) Failure

func (c ContractLogger) Failure(event string, err error, kv ...any)

Failure records a failed bootstrap event.

func (ContractLogger) Start

func (c ContractLogger) Start(event string, kv ...any)

Start records the beginning of a bootstrap event.

func (ContractLogger) Success

func (c ContractLogger) Success(event string, kv ...any)

Success records a successful bootstrap event.

func (ContractLogger) WithComponent

func (c ContractLogger) WithComponent(component string) ContractLogger

WithComponent returns a copy targeting a nested component.

func (ContractLogger) WithStage

func (c ContractLogger) WithStage(meta stagemeta.Metadata) ContractLogger

WithStage attaches Stage metadata that will be appended to every event.

type Entry

type Entry struct {
	Kind           string
	Name           string
	Register       func() error
	ErrMessage     string
	SuccessMessage string
	Fields         []any
}

Entry describes a single component registration.

type Runner

type Runner struct {
	Log logr.Logger
}

Runner coordinates startup registrations (controllers, webhooks, health checks, etc.) and emits consistent structured logs for both success and failure paths.

func (Runner) Register

func (r Runner) Register(entries ...Entry) error

Register executes every entry sequentially. The first failure is logged and returned so callers decide whether to exit or retry; successes emit a log entry so operators know which components finished wiring.

Jump to

Keyboard shortcuts

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