temporal

package
v0.0.0-...-ad95c11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

temporal

Thin factory for creating a configured Temporal client. Used by both the macro workflow runner and the taskflow micro-workflow subsystem.

Usage

import "github.com/OpenNSW/core/temporal"

client, err := temporal.NewClient(temporal.Config{
    Host:      "localhost",
    Port:      7233,
    Namespace: "default",
})
if err != nil {
    log.Fatal(err)
}
defer client.Close()

The returned client.Client is the standard Temporal Go SDK client. Pass it to workflow.NewTemporalManager and taskflow/orchestrator.NewTaskManager.

Config

Field Type Description
Host string Temporal server hostname
Port int Temporal server port (default 7233)
Namespace string Temporal namespace (default "default")

Local development

Run a local Temporal server with the Temporal CLI:

temporal server start-dev

This starts a server at localhost:7233 in the default namespace with an in-memory store and an embedded UI at http://localhost:8233.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(cfg Config) (client.Client, error)

NewClient creates a shared Temporal client for all workflow runtimes.

Types

type Config

type Config struct {
	Host      string
	Port      int
	Namespace string
}

Config holds configuration required to connect to Temporal.

This is owned by the temporal package (similar to other internal packages), so the package controls the shape/semantics of its configuration.

Host/Port are kept separate to make configuration via environment variables easier and more explicit.

func (Config) Validate

func (c Config) Validate() error

Validate ensures the Temporal configuration is usable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL