Documentation
¶
Overview ¶
Package temporal provides a lakta module for Temporal workflow orchestration.
Index ¶
- type Config
- func (c *Config) ClientOptions(logger log.Logger, interceptors []interceptor.ClientInterceptor) client.Options
- func (c *Config) DialOptions() []grpc.DialOption
- func (c *Config) GetCredentials() credentials.TransportCredentials
- func (c *Config) LoadFromKoanf(k *koanf.Koanf, path string) error
- func (c *Config) WorkerOptions(ctx context.Context, interceptors []interceptor.WorkerInterceptor) worker.Options
- type Module
- type Option
- type Registrar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Instance name
Name string `koanf:"-"`
// Target specifies the Temporal server's target address for client connections.
Target string `koanf:"target"`
// TaskQueue specifies the Temporal task queue name for workflow and activity execution.
TaskQueue string `koanf:"task_queue" required:"true"`
// Namespace defines the Temporal namespace to be used for client and worker operations.
Namespace string `koanf:"namespace"`
// Insecure indicates whether transport credentials should be bypassed, enabling an insecure connection.
Insecure bool `koanf:"insecure"`
// Credentials specifies the TransportCredentials for secure communication with Temporal services.
Credentials credentials.TransportCredentials `code_only:"true" koanf:"-"`
// Registrars holds a list of functions for registering workflows and activities on a Temporal worker.
Registrars []Registrar `code_only:"WithRegistrar" koanf:"-"`
}
Config holds Temporal client and worker connection settings.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig returns default configuration
func (*Config) ClientOptions ¶
func (c *Config) ClientOptions(logger log.Logger, interceptors []interceptor.ClientInterceptor) client.Options
ClientOptions returns temporal client.Options with config values applied.
func (*Config) DialOptions ¶
func (c *Config) DialOptions() []grpc.DialOption
DialOptions returns grpc.DialOption slice for the temporal client connection.
func (*Config) GetCredentials ¶
func (c *Config) GetCredentials() credentials.TransportCredentials
GetCredentials returns the transport credentials, applying Insecure if set.
func (*Config) LoadFromKoanf ¶
LoadFromKoanf loads configuration from koanf instance at the given path.
func (*Config) WorkerOptions ¶
func (c *Config) WorkerOptions(ctx context.Context, interceptors []interceptor.WorkerInterceptor) worker.Options
WorkerOptions returns temporal worker.Options with config values applied.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module manages a Temporal client and worker lifecycle.
func (*Module) ConfigPath ¶
ConfigPath returns the koanf path for this module's configuration.
func (*Module) LoadConfig ¶
LoadConfig loads configuration from koanf.
type Option ¶
type Option func(m *Config)
Option configures the Module.
func WithInsecure ¶ added in v0.0.2
WithInsecure enables or disables insecure transport credentials.
func WithNamespace ¶ added in v0.0.2
WithNamespace sets the Temporal namespace.
func WithRegistrar ¶
WithRegistrar adds a workflow/activity registrar (code-only).
func WithTarget ¶ added in v0.0.2
WithTarget sets the target address for the Temporal server.
func WithTaskQueue ¶ added in v0.0.2
WithTaskQueue sets the Temporal task queue name.