yaml

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package yaml is the "yaml" host module. See std/encoding/register.go for why this and its eight siblings each get their own leaf package instead of living in std's flat root, and how this directory's Module reaches the rest of magus without std importing back down to collect it.

Index

Constants

This section is empty.

Variables

View Source
var Module = std.Module{
	Name: "yaml",
	WASM: true,
	Path: "encoding/yaml",
	Doc:  "YAML parse and stringify (YAML 1.2 via gopkg.in/yaml.v3).",
	Methods: []std.Method{
		{
			Name:    "parse",
			Doc:     "Decode a YAML string into a value (maps, lists, strings, numbers, bools, null); errors on invalid input.",
			Args:    []std.Arg{{Name: "source", Type: std.TypeString}},
			Returns: []std.Ret{{Type: std.TypeAny}},
			Raises:  true,
			Impl:    YAMLParse,
		},
		{
			Name:    "stringify",
			Doc:     "Encode a value to a YAML string; errors on unencodable input.",
			Args:    []std.Arg{{Name: "value", Type: std.TypeAny}},
			Returns: []std.Ret{{Type: std.TypeString}},
			Raises:  true,
			Impl:    YAMLStringify,
		},
	},
}

Module is the "yaml" host module: YAML parse and stringify via gopkg.in/yaml.v3.

Functions

func Modules

func Modules() []std.Module

Modules returns this directory's contribution to the encoding module set. See std/encoding/register.go: it aggregates every leaf's Modules() into one slice, which is how a module here reaches std.All()'s callers without std importing this package to collect it.

func YAMLParse

func YAMLParse(_ context.Context, source string) (any, error)

YAMLParse decodes source as YAML. gopkg.in/yaml.v3 decodes maps as map[string]interface{} when the target is interface{}, so the result is safe to pass directly to the Buzz boundary.

func YAMLStringify

func YAMLStringify(_ context.Context, value any) (string, error)

YAMLStringify encodes value to a YAML string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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