spec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package spec loads and validates cluster.yaml.

Index

Constants

This section is empty.

Variables

View Source
var Roles = []string{"frontend", "history", "matching", "worker"}

Roles are the Temporal services a node can run, in stage order: frontends start first, because every later gate reads the cluster through them.

Functions

func Defaults

func Defaults(c *Cluster)

Defaults fills every field the operator left empty with its documented default

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a Go duration ("72h", "90m") or a whole number of days ("7d"). Go's time.ParseDuration has no unit for days, and retention is usually written in days.

Types

type Access

type Access struct {
	Clients      []string `yaml:"clients"`
	Monitors     []string `yaml:"monitors"`
	Admins       []string `yaml:"admins"`
	Healthchecks []string `yaml:"healthchecks"`
}

Access lists the sources allowed through each node's firewall.

type Cluster

type Cluster struct {
	Cluster     string      `yaml:"cluster"`
	Temporal    Temporal    `yaml:"temporal"`
	Shards      int         `yaml:"shards"`
	Persistence Persistence `yaml:"persistence"`
	SSH         SSH         `yaml:"ssh"`
	Access      Access      `yaml:"access"`
	Namespaces  []Namespace `yaml:"namespaces"`
	Nodes       []Node      `yaml:"nodes"`
	// contains filtered or unexported fields
}

Cluster is the desired state of one Temporal cluster: the contents of cluster.yaml.

func Parse

func Parse(file string, data []byte) (*Cluster, error)

Parse decodes a cluster spec; file names it in errors. YAML that does not parse is an error; unknown keys and wrong types are kept for Validate to report as problems.

type Namespace

type Namespace struct {
	Name      string `yaml:"name"`
	Retention string `yaml:"retention"`
}

Namespace is a Temporal namespace tops keeps in place.

type Node

type Node struct {
	Name    string   `yaml:"name"`
	Address string   `yaml:"address"`
	Roles   []string `yaml:"roles"`
}

Node is one host running Temporal.

type Persistence

type Persistence struct {
	Postgres *Postgres `yaml:"postgres"`
}

Persistence names the datastore. Exactly one kind is set.

type Postgres

type Postgres struct {
	Host          string `yaml:"host"`
	Port          int    `yaml:"port"`
	User          string `yaml:"user"`
	TLS           bool   `yaml:"tls"`
	AdminDatabase string `yaml:"adminDatabase"`
}

Postgres is how Temporal reaches its PostgreSQL server.

type Problem

type Problem struct {
	File    string `json:"file,omitempty"`
	Path    string `json:"path"`
	Line    int    `json:"line"`
	Message string `json:"message"`
}

Problem is one thing wrong with a spec, named by its path and its line in the file.

func Validate

func Validate(c *Cluster) []Problem

Validate checks a spec after Defaults and returns every problem, not only the first, so the operator can fix them all in one pass.

func (Problem) String

func (p Problem) String() string

type SSH

type SSH struct {
	User       string `yaml:"user"`
	Port       int    `yaml:"port"`
	Key        string `yaml:"key"`
	KnownHosts string `yaml:"knownHosts"`
}

SSH is how tops reaches the nodes.

type Temporal

type Temporal struct {
	Version  string `yaml:"version"`
	CLI      string `yaml:"cli"`
	LogLevel string `yaml:"logLevel"`
}

Temporal selects the Temporal server and CLI releases.

type UI

type UI struct {
	Node    string `yaml:"node"`
	Version string `yaml:"version"`
}

UI places the Temporal Web UI on one node.

Jump to

Keyboard shortcuts

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