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.