yaml

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package yaml contains the yaml node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YAMLConfig

type YAMLConfig struct {
	// Action selects the conversion: "" (auto: stringify objects, parse
	// strings) | "str" (always stringify) | "obj" (always parse)
	Action string `json:"action"`
	// Property is the message field to convert; "payload" (default)
	// targets msg.Payload, otherwise a dotted path inside the data map
	Property string `json:"property"`
	// Outputs is the node port count; 2 adds a second port that receives
	// messages whose YAML failed to parse (error info in Metadata.error)
	Outputs int `json:"outputs"`
}

YAMLConfig holds configuration for the yaml node — same shape as the json node (yaml.v3 is already vendored).

type YAMLNode

type YAMLNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

YAMLNode converts payload data between YAML string and object form.

func NewYAMLNode

func NewYAMLNode(node nodestore.NodeInterface, config *YAMLConfig) *YAMLNode

NewYAMLNode creates a new yaml node

func (*YAMLNode) Execute

Execute reads the configured property, converts it and writes the result back. A parse failure either routes to output_2 (when the node has two outputs) or aborts the branch with an error status.

func (*YAMLNode) SelectPorts

func (n *YAMLNode) SelectPorts(input, output nodestore.MessageInterface) []string

SelectPorts routes the message to output_2 when the last Execute hit a parse error, otherwise to output_1.

Jump to

Keyboard shortcuts

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