ref

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ref defines typed cross-repo entity references.

A TypedRef uses the format "{type}:{slug}" to reference entities across repository boundaries. For example, "market:identity-governance" references a market defined in MarketSpec, and "customer:acme-001" references a customer entity in OrganizationSpec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(r TypedRef) error

Validate checks that a TypedRef is well-formed and uses a known type.

func ValidateSlug

func ValidateSlug(slug string) error

ValidateSlug checks that a slug contains only lowercase alphanumeric characters and hyphens, and does not start or end with a hyphen.

func ValidateStrict

func ValidateStrict(r TypedRef) error

ValidateStrict checks format, known type, and slug validity.

Types

type RefType

type RefType string

RefType is a well-known entity reference type.

const (
	TypeCustomer      RefType = "customer"
	TypeCapability    RefType = "capability"
	TypeMarket        RefType = "market"
	TypeCompetitor    RefType = "competitor"
	TypeAnalystReport RefType = "analyst-report"
)

func KnownTypes

func KnownTypes() []RefType

KnownTypes returns all well-known reference types.

func Parse

func Parse(r TypedRef) (RefType, string, error)

Parse splits a TypedRef into its type and slug components. Returns an error if the format is invalid.

type TypedRef

type TypedRef string

TypedRef is a cross-repo entity reference in "{type}:{slug}" format.

func New

func New(t RefType, slug string) TypedRef

New creates a TypedRef from a type and slug.

Jump to

Keyboard shortcuts

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