tablevalue

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tablevalue builds a JSON object from a step's table of paths and values, for the steps that send one they make from scratch: an operation's variables, a tool's arguments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(base map[string]any, rows []Row, expand Expand) (map[string]any, error)

Apply sets the rows into an object, as Build does: the object a file gave, which the rows change.

func Build

func Build(rows []Row, expand Expand) (map[string]any, error)

Build is the object the rows make, with the objects and arrays on their paths. A value means what it says (core.ParseValue, ADR 0014): `42` is a number, `"42"` the string, `null` null, and `undefined` leaves the path out; nothing is inferred from a schema. expand, when not nil, expands the strings' references.

Types

type Expand added in v0.3.0

type Expand func(string) (string, error)

Expand expands the references in a string (`${secret:…}`, `${env:…}`) of a value, or of a JSON value: after the value is read, so a reference is text, whatever it expands to.

type Row

type Row struct {
	Path, Value string
	// Null is an empty cell, which is an error asking for the value.
	Null bool
}

Row is a row of the table: a path (`reference`, `address.postcode`, `lines[0].reference`) and its value.

Jump to

Keyboard shortcuts

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