Documentation
¶
Overview ¶
Package temporalclient builds a Temporal SDK client configured via the envconfig package, with two extensions on top:
- file:// API keys: when the resolved API key has the form "file:///absolute/path", the path is read on every RPC via client.NewAPIKeyDynamicCredentials, so external rotators that update the file in place are picked up without a process restart.
- Startup health check: Dial verifies the gRPC connection to the frontend before returning. The underlying client.Dial is lazy and would otherwise return a healthy-looking client even when the server is unreachable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(ctx context.Context, reg prometheus.Registerer) (client.Client, func(), error)
Dial loads Temporal client options via envconfig, expands a file:// API key into dynamic credentials when present, verifies the gRPC connection via CheckHealth, and bridges Temporal SDK metrics onto reg so they appear on the same /metrics endpoint as application metrics. Pass nil for reg to disable SDK metrics entirely.
The returned shutdown function must be deferred by the caller. It flushes pending SDK metric samples, stops the tally reporter goroutine, and closes the Temporal client. It is safe to call more than once. When Dial returns a non-nil error the shutdown is a no-op so callers can `defer shutdown()` unconditionally.
Types ¶
This section is empty.