Documentation
¶
Overview ¶
Package temporal is a Temporal client as a dependency: a configuration section, a client traced and measured through the service's OpenTelemetry providers and logging through its logger, a health probe. The SDK's own connection (BACKPLANE_TEMPORAL_*: hooks, activities, workflows) dials through Options too.
For a Temporal of the service's own — another cluster or namespace:
type Config struct {
config.Backplane `json:"backplane"`
Billing temporal.Config `json:"billing"` // SHOP_BILLING_ADDR, _NS, ...
}
billing := deps.NewDependency(root, temporal.New(cfg.Billing), deps.Name("billing"))
run, err := billing.Get().ExecuteWorkflow(ctx, opts, "Charge", in)
Index ¶
Constants ¶
View Source
const ( DefaultNamespace = "default" DefaultDialTimeout = 2 * time.Second )
Defaults of Config.
Variables ¶
View Source
var ErrNoAddr = errors.New("temporal: addr is required")
ErrNoAddr: the section has no address.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Addr is the frontend's host:port.
Addr string `json:"addr,omitempty"`
Namespace string `json:"ns" schemapb:"default=default"`
TLS config.TLS `json:"tls"`
// APIKey authenticates to Temporal Cloud; it turns TLS on even when TLS
// is not enabled.
APIKey config.Secret `json:"api_key,omitempty"`
// DialTimeout bounds one connection attempt.
DialTimeout time.Duration `json:"dial_timeout" schemapb:"default=2s"`
}
Config is the connection's section. Field `ns`: `namespace` is a CEL reserved word.
func (Config) Validate ¶
Validate checks what the schema cannot: the address is set and the TLS material parses.
func (Config) WithDefaults ¶
WithDefaults fills a zero namespace and dial timeout.
Click to show internal directories.
Click to hide internal directories.