bootstrap

package
v1.22.10 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bootstrap provides the minimal, environment-only configuration a TMI worker component needs to start and reach the point where it can accept a job. It is deliberately separate from internal/config: a worker MUST NOT import the monolith's configuration cascade. Everything else a worker needs arrives in the job envelope (config.StampedConfig) or is resolved from a mounted secret.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkerBootstrap

type WorkerBootstrap struct {
	// NATSURL is the JetStream connection URL (env TMI_NATS_URL, shared with internal/worker). Required — a worker cannot
	// receive a job without it.
	NATSURL string
	// HeartbeatSubject is the NATS subject the worker publishes liveness on.
	HeartbeatSubject string
	// SecretMounts maps a logical secret name to the filesystem path of a
	// mounted Kubernetes Secret. The worker reads secret values from these
	// paths; secret values never travel over NATS or the config cascade.
	SecretMounts map[string]string
	// LogLevel is the worker log level; defaults to "info".
	LogLevel string
}

WorkerBootstrap is the complete startup configuration of a worker.

func LoadWorker

func LoadWorker() (*WorkerBootstrap, error)

LoadWorker builds a WorkerBootstrap from environment variables only. It reads no YAML and touches no database.

func (*WorkerBootstrap) ReadSecret

func (wb *WorkerBootstrap) ReadSecret(logicalName string) (string, error)

ReadSecret reads the secret value for a logical name from its mounted path.

Jump to

Keyboard shortcuts

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