catalog

package
v0.19.930 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package catalog is the in-memory registry for CompositeError types and Parsers, populated via init() blocks in per-type packages.

This mirrors pkg/queue/catalog: there is no DB-backed catalog table. On every process start, importing a type's package runs its init() which registers the factory and parser(s) here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllParsers

func AllParsers() []composite_error.Parser

AllParsers returns every registered parser, in registration order. Used by the admin dashboard catalog browser.

func Hydrate

Hydrate looks up the factory for typ, instantiates an empty value, and unmarshals data into it. Returns an error if the type is not registered or the JSON does not match the type's schema.

func LookupType

func LookupType(typ composite_error.Type) (func() composite_error.CompositeError, bool)

LookupType returns the factory registered for typ, or (nil, false).

func ParsersForContext

func ParsersForContext(c composite_error.ParseContext) []composite_error.Parser

ParsersForContext returns the parsers that should be invoked for a given dispatch context, ordered most-specific to least-specific. Within a level parsers are returned in registration order.

Walking is by "/"-segment ancestry: "terraform/plan" matches parsers registered against "terraform/plan", "terraform", and "" (root).

func RegisterParser

func RegisterParser(p composite_error.Parser)

RegisterParser indexes p under each of its declared ParseContexts. Panics if Contexts() is empty — every parser must opt in to at least one subtree (see specs/composite-errors.md).

func RegisterType

func RegisterType(typ composite_error.Type, fn func() composite_error.CompositeError)

RegisterType associates a CompositeError type with its factory. Panics on duplicate registration — same contract as pkg/queue/catalog.

The factory must return a fresh, zero-valued instance of the implementing struct on each call.

func Reset

func Reset()

Reset clears all registrations. Test-only.

func Types

func Types() []composite_error.Type

Types returns all registered type identifiers, sorted. Useful for the admin dashboard catalog browser.

Types

This section is empty.

Jump to

Keyboard shortcuts

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