keys

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package keys encodes and decodes the engine's composite flow and step keys. A key is "{shard}-{id}-{token}" with a 1-based shard: the shard routes the request, the id is the per-shard sequential row id, and the random token is an unguessable write capability. CorrelationID derives the token-free, capability-free identifier that observability sinks must use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorrelationID

func CorrelationID(shardNum, flowID int) string

CorrelationID is the non-secret, capability-free flow identifier for telemetry (spans, logs, metrics): the flowKey with its random token segment omitted. It uniquely identifies the flow for correlation - {shard} disambiguates the per-shard sequential flow_id - but grants nothing. It is deliberately NOT a valid engine key: no operation accepts it, and the engine offers no correlationID->key lookup, so a trace/log reader cannot escalate it into the flow's write capability. Every place a flow identifier crosses into an observability sink must use this, never the token-bearing key (which belongs only on the task carrier and in-memory waiter matching).

func ParseFlowKey

func ParseFlowKey(flowKey string) (shardNum int, flowID int, flowToken string, err error)

ParseFlowKey extracts the shard, numeric flow ID and flow token from a composite flow key. Format: "{shard}-{flowID}-{token}" with a 1-based shard.

func ParseStepKey

func ParseStepKey(stepKey string) (shardNum int, stepID int, stepToken string, err error)

ParseStepKey extracts the shard, numeric step ID and step token from a composite step key. Format: "{shard}-{stepID}-{token}" with a 1-based shard.

func RandomIdentifier

func RandomIdentifier(n int) string

RandomIdentifier generates a random hex string of the given byte length. It mints the unguessable token segment of flow and step keys.

Types

This section is empty.

Jump to

Keyboard shortcuts

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