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. SEM@7b63ecf38ff4d7eac724b5c8b36efc784b466c6f: configuration struct holding worker startup settings from environment (pure)
func LoadWorker ¶
func LoadWorker() (*WorkerBootstrap, error)
LoadWorker builds a WorkerBootstrap from environment variables only. It reads no YAML and touches no database. SEM@946ec29: build worker startup config from environment variables only, no YAML or DB (pure)
func (*WorkerBootstrap) ReadSecret ¶
func (wb *WorkerBootstrap) ReadSecret(logicalName string) (string, error)
ReadSecret reads the secret value for a logical name from its mounted path. SEM@7b63ecf38ff4d7eac724b5c8b36efc784b466c6f: fetch a mounted Kubernetes secret value by logical name from the filesystem