stepid

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stepid owns senro's step identifier grammar.

stepID   := segment ("/" segment)*         "deploy/discover/apply-west"
expanded := stepID "[" k=v ("," k=v)* "]"  keys sorted
address  := (stepID|expanded) ["@" N]      CLI surface only, N >= 1

The attempt suffix is an addressing form for the CLI and never appears in an event's step field, where attempt is its own routing field.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) (string, error)

Decode reverses Encode.

func Encode

func Encode(id string) string

Encode makes a step ID safe as a single filesystem path segment while keeping it readable, which matters when reading a run's logs from disk.

func Format

func Format(base string, keys map[string]string) string

Format builds an expanded child ID. Keys are sorted so that an expander returning map iteration order still produces a stable, reproducible ID.

func Keys

func Keys(id string) (base string, keys map[string]string, ok bool)

Keys reverses Format, splitting an expanded ID into its base and key set. A bare ID with no bracket group is a base and no keys, with ok true.

ok is false for anything off the grammar and must not be ignored: its caller reads a unit back out of a child's ID to record how long that unit's step took, and guessing would credit one unit's time to another.

It unescapes nothing because Format escapes nothing: an expansion refuses a unit whose ID contains a delimiter (senro's unitIDNeedsEscaping), so a value here can never contain "[", "]", "=" or ",".

func ParseAddress

func ParseAddress(s string) (string, int, error)

ParseAddress splits a CLI address into its step ID and attempt number. An absent @N yields attempt 0, meaning "unspecified".

Types

This section is empty.

Jump to

Keyboard shortcuts

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