 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func Provide() fx.Option
- func ProvideClient[T generatedClient, O any](newClientFn func(client.Client, ...O) T, opts ...O) fx.Option
- func ProvideRegistration[W, A any](queueName string, regFn func(worker worker.Worker, wf W, act A)) fx.Option
- type Client
- type ClientInterceptor
- type Config
- type Registration
- type Temporal
- type WorkerInterceptor
- func (w *WorkerInterceptor) InterceptActivity(ctx context.Context, next interceptor.ActivityInboundInterceptor) interceptor.ActivityInboundInterceptor
- func (w *WorkerInterceptor) InterceptWorkflow(ctx workflow.Context, next interceptor.WorkflowInboundInterceptor) interceptor.WorkflowInboundInterceptor
 
- type Workers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvideClient ¶ added in v0.0.166
Types ¶
type Client ¶
type Client[T generatedClient] struct{ W T }
    Client wraps a generated Workflow client. The wrapping simply exists so we can set the underlying temporal client in a "onStart" hook.
type ClientInterceptor ¶
type ClientInterceptor struct {
	interceptor.ClientInterceptorBase
	// contains filtered or unexported fields
}
    ClientInterceptor validates workflow & signal/update args on the caller side.
func NewClientInterceptor ¶
func NewClientInterceptor(val protovalidate.Validator) *ClientInterceptor
func (*ClientInterceptor) InterceptClient ¶
func (c *ClientInterceptor) InterceptClient( next interceptor.ClientOutboundInterceptor, ) interceptor.ClientOutboundInterceptor
type Config ¶
type Config struct {
	// temporal server grpc
	TemporalHostPort string `env:"TEMPORAL_HOST_PORT" envDefault:"localhost:7233"`
	// temporal namespace for this deployment
	TemporalNamespace string `env:"TEMPORAL_NAMESPACE" envDefault:"default"`
	// API key for authentication with the cluster.
	TemporalAPIKey string `env:"TEMPORAL_API_KEY"`
	// create and use randomly-named namespace, mainly for testing.
	CreateAndUseRandomNamespace bool `env:"CREATE_AND_USE_RANDOM_NAMESPACE"`
	// remove the namespace when the client shuts down, only taken into account with: CREATE_AND_USE_RANDOM_NAMESPACE
	AutoRemoveNamespace bool `env:"AUTO_REMOVE_NAMESPACE"`
	// in some cases the workers are not necessary to be run (such as when the code is also run as a Lambda)
	DisableWorkers bool `env:"DISABLE_WORKERS"`
}
    type Registration ¶
type Registration struct {
	// contains filtered or unexported fields
}
    Registration describes registering of workflow and activities with a worker.
type Temporal ¶
type Temporal struct {
	// contains filtered or unexported fields
}
    Temporal holds a reference to the Temporal Temporal.
func New ¶
func New(par struct {
	fx.In
	fx.Lifecycle
	Config            Config
	Logger            *zap.Logger
	ClientInterceptor *ClientInterceptor
},
) (*Temporal, error)
    New inits the Temporal client.
type WorkerInterceptor ¶
type WorkerInterceptor struct {
	interceptor.InterceptorBase
	// contains filtered or unexported fields
}
    func NewWorkerInterceptor ¶
func NewWorkerInterceptor( val protovalidate.Validator, logs *zap.Logger, ) *WorkerInterceptor
NewWorkerInterceptor initializes an interceptor for our worker. It implements cross-cutting concerns for all activity and workflow execution. Such as input validation.
func (*WorkerInterceptor) InterceptActivity ¶
func (w *WorkerInterceptor) InterceptActivity( ctx context.Context, next interceptor.ActivityInboundInterceptor, ) interceptor.ActivityInboundInterceptor
InterceptActivity intercepts activities.
func (*WorkerInterceptor) InterceptWorkflow ¶
func (w *WorkerInterceptor) InterceptWorkflow( ctx workflow.Context, next interceptor.WorkflowInboundInterceptor, ) interceptor.WorkflowInboundInterceptor
InterceptWorkflow intercepts workflows.
type Workers ¶
type Workers struct {
	// contains filtered or unexported fields
}
    Workers represent the set of Temporal workers.
func NewWorkers ¶
func NewWorkers(par struct {
	fx.In
	fx.Lifecycle
	Logger            *zap.Logger
	Temporal          *Temporal
	WorkerInterceptor *WorkerInterceptor
	Registrations     []*Registration `group:"registrations"`
},
) (*Workers, error)
    NewWorkers inits a new set of workers.