expand usage notes

This commit is contained in:
Jay
2026-05-09 11:48:48 -04:00
parent 081f94f35d
commit 3b90b9bb59
+12 -1
View File
@@ -73,8 +73,19 @@ func NewWorker(ctx context.Context, id string, handler slog.Handler) (*Worker, e
At the connection layer, another `MustExtend` call extends the path to At the connection layer, another `MustExtend` call extends the path to
`outbound_pool.outbound_worker.connection` with no additional plumbing. `outbound_pool.outbound_worker.connection` with no additional plumbing.
### Usage Notes
**Error-Returning vs Panic Variants**:
- Use `New` and `Extend` when a missing or invalid component is a recoverable
condition.
- Use `MustNew` and `MustExtend` at library boundaries where a missing
component is a programming error that should halt execution immediately.
**Generic Output**:
`GetFields` provides the component fields as a `map[string]string` for non-slog `GetFields` provides the component fields as a `map[string]string` for non-slog
consumers. consumers such as OpenTelemetry or Prometheus.
## Testing ## Testing