registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package registry stores flow definitions immutably in KV: key "<name>.<hash>" holds the definition, "<name>.latest" the hash of the most recently registered version. Every execution records the hash it started with, so deploying a new version never changes executions in flight.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownFlow = errors.New("registry: unknown flow")

ErrUnknownFlow is returned for a flow (or version) that is not registered.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry reads and writes flow definitions, caching immutable versions.

func New

func New(in *infra.Infra) *Registry

New returns a Registry.

func (*Registry) Get

func (r *Registry) Get(ctx context.Context, name, hash string) (*flow.Flow, error)

Get returns version hash of flow name ("" = latest).

func (*Registry) Latest

func (r *Registry) Latest(ctx context.Context, name string) (string, error)

Latest returns the latest version hash of name.

func (*Registry) List

func (r *Registry) List(ctx context.Context) ([]Version, error)

List returns every registered version, sorted.

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, def *flow.Flow) (string, error)

Register stores def (validated) and makes it the latest version. It is idempotent; it returns the version hash.

type Version

type Version struct {
	Name   string `json:"name"`
	Hash   string `json:"hash"`
	Latest bool   `json:"latest"`
}

Version describes one registered version.

Jump to

Keyboard shortcuts

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