Documentation
¶
Index ¶
- func AsWorker(f any) any
- func New(v *validator.Validate, opts ...workerOption) (*worker, error)
- func WithActivity(act interface{}) workerOption
- func WithConfig(cfg *Config) workerOption
- func WithContextPropagator(propagator workflow.ContextPropagator) workerOption
- func WithLogger(l *zap.Logger) workerOption
- func WithMetricsWriter(mw metrics.Writer) workerOption
- func WithNamespace(ns string) workerOption
- func WithWorkers(f any) any
- func WithWorkflow(wkflow interface{}) workerOption
- type Config
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithActivity ¶
func WithActivity(act interface{}) workerOption
func WithConfig ¶
func WithConfig(cfg *Config) workerOption
func WithContextPropagator ¶
func WithContextPropagator(propagator workflow.ContextPropagator) workerOption
func WithLogger ¶
func WithMetricsWriter ¶
func WithNamespace ¶
func WithNamespace(ns string) workerOption
func WithWorkers ¶
func WithWorkflow ¶
func WithWorkflow(wkflow interface{}) workerOption
Types ¶
type Config ¶
type Config struct {
// builtin configuration
Env config.Env `config:"env" validate:"required"`
ServiceName string `config:"service_name" validate:"required"`
GitRef string `config:"git_ref" validate:"required"`
Version string `config:"version" validate:"required"`
// temporal configuration
TemporalHost string `config:"temporal_host" validate:"required"`
TemporalNamespace string `config:"temporal_namespace"`
TemporalTaskQueue string `config:"temporal_task_queue" validate:"required"`
TemporalMaxConcurrentActivities int `config:"temporal_max_concurrent_activities" validate:"required" faker:"oneof: 10,20"`
// observability configuration
HostIP string `config:"host_ip" validate:"required"`
LogLevel string `config:"log_level"`
SlowQueryThresholdMS int `config:"slow_query_threshold_ms"`
}
Config defines the standard workflow worker config, which all workers should embed as part of their application.
Click to show internal directories.
Click to hide internal directories.