cause

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package cause provides a context key for threading automation correlation information through call chains. It is intentionally minimal to avoid import cycles: both internal/automation/action and internal/carport can import it without either depending on the other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCorrelation

func WithCorrelation(ctx context.Context, c Correlation) context.Context

WithCorrelation attaches an automation Correlation to ctx.

Types

type Correlation

type Correlation struct {
	AutomationID  string
	CorrelationID string
}

Correlation carries the automation identity of the call that triggered a downstream dispatch. Downstream consumers (e.g. carport.Host.Dispatch) read it via FromCorrelation to stamp the Source field on CommandIssued events.

func FromCorrelation

func FromCorrelation(ctx context.Context) (Correlation, bool)

FromCorrelation returns the Correlation attached to ctx, if any.

Jump to

Keyboard shortcuts

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