state

package
v0.35.0 Latest Latest
Warning

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

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

Documentation

Overview

Package state describes a service's migration state: the modules a migration moves, the IO each performs, and how far each has got.

Index

Constants

View Source
const Library = "library"

Library is the node type of shared code that performs no IO.

Variables

This section is empty.

Functions

func WriteTypes

func WriteTypes(out io.Writer, config TypesConfig, palette terminal.Palette, catalog *boundary.Catalog) error

WriteTypes writes every node type with its description and settings, for an agent that writes the migration state.

Types

type NodeType

type NodeType struct {
	// Name is how the type is referred to, e.g. "library" or "ingress[http]".
	Name string `json:"name"`
	// Description says what code has the type and how to recognise it.
	Description string `json:"description"`
	// Table is where a node of an IO kind holds its settings, or empty for library.
	Table string `json:"table,omitzero"`
	// Settings are the fields the table can hold.
	Settings []boundary.Setting `json:"settings,omitzero"`
}

NodeType is a type that a node in the migration state can have.

func NodeTypes

func NodeTypes(catalog *boundary.Catalog) []NodeType

NodeTypes returns library, then each kind of IO the catalog supports.

type TypesConfig

type TypesConfig struct {
	// JSON prints the node types as a JSON array instead of text.
	JSON bool `help:"Print JSON instead of text."`
}

TypesConfig selects how node types are printed.

Jump to

Keyboard shortcuts

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