livingid

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package livingid builds and parses stable resource URNs used by living Sagas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(reference Reference) (string, error)

Build returns the canonical URN for reference.

func Citation

func Citation(sagaID, citationID string) (string, error)

Citation builds a stable citation URN.

func Contract

func Contract(sagaID, contractID string) (string, error)

Contract builds a stable contract URN.

func Criterion

func Criterion(sagaID, storyID, criterionID string) (string, error)

Criterion builds a stable criterion URN within a story.

func DefinitionRevision

func DefinitionRevision(sagaID string, parentKind Kind, parentID, revisionID string) (string, error)

DefinitionRevision builds a stable revision URN for a story, wave, work-item, or contract definition.

func Dependency

func Dependency(sagaID, dependencyID string) (string, error)

Dependency builds a stable dependency URN.

func Design

func Design(sagaID string, kind DesignKind, designID string) (string, error)

Design builds a stable chapter, section, or fragment design target. Use Landmark for a landmark nested beneath a fragment.

func Landmark

func Landmark(sagaID, fragmentID, landmarkID string) (string, error)

Landmark builds a stable landmark design target within a fragment.

func Relation

func Relation(sagaID, relationID string) (string, error)

Relation builds a stable relation URN.

func Revision

func Revision(sagaID, storyID, revisionID string) (string, error)

Revision builds a stable revision URN within a story.

func Story

func Story(sagaID, storyID string) (string, error)

Story builds a stable story URN.

func ValidID

func ValidID(value string) bool

ValidID reports whether value uses the stable-ID grammar shared by Saga resources.

func Wave

func Wave(sagaID, waveID string) (string, error)

Wave builds a stable wave URN.

func WorkItem

func WorkItem(sagaID, itemID string) (string, error)

WorkItem builds a stable work-item URN.

Types

type DesignKind

type DesignKind string

DesignKind is the existing addressable package kind reused beneath the v3 design root.

const (
	DesignChapter  DesignKind = "chapter"
	DesignSection  DesignKind = "section"
	DesignFragment DesignKind = "fragment"
	DesignLandmark DesignKind = "landmark"
)

type Kind

type Kind string

Kind identifies a living-Saga resource class. Design targets keep their existing chapter, section, fragment, or landmark spelling in the URN while parsing to KindDesign.

const (
	KindStory      Kind = "story"
	KindCriterion  Kind = "criterion"
	KindRevision   Kind = "revision"
	KindCitation   Kind = "citation"
	KindRelation   Kind = "relation"
	KindDesign     Kind = "design"
	KindWave       Kind = "wave"
	KindWorkItem   Kind = "work-item"
	KindDependency Kind = "dependency"
	KindContract   Kind = "contract"
)

type Reference

type Reference struct {
	SagaID     string
	Kind       Kind
	ID         string
	ParentID   string
	ParentKind Kind
	DesignKind DesignKind
}

Reference is the structured form of a stable living-Saga URN.

ParentID is the story ID for criteria and revisions, and the fragment ID for design landmarks. DesignKind is set only when Kind is KindDesign.

func Parse

func Parse(value string) (Reference, error)

Parse returns the structured form of a canonical living-Saga resource URN.

Jump to

Keyboard shortcuts

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