literalsource

package
v1.234.0-rc.1 Latest Latest
Warning

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

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

Documentation

Overview

Package literalsource preserves scalar !literal values across stack merging and evaluation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(value string) (string, bool)

Decode recognizes a complete canonical envelope and returns its original text.

func Encode

func Encode(value string) string

Encode preserves the exact scalar text in an internal string envelope.

func ProtectEncoded

func ProtectEncoded(input, left, right string) (string, func(string) string)

ProtectEncoded prevents even delimiter pairs that overlap our envelope syntax from interpreting a literal. Tokens use characters absent from the input and delimiters. Restore after each pass, before parsing the rendered YAML or choosing new delimiters.

func ProtectYAML

func ProtectYAML(input string) (string, func(string) string, error)

ProtectYAML hides tagged scalar bodies before a manifest's first template pass. Its restore callback reinstates the original tagged strings only after all passes.

func Restore

func Restore(value any) any

Restore returns a detached tree with literal envelopes decoded exactly once. Never recursively decode a recovered string: it may itself intentionally resemble an envelope.

func RestoreMap

func RestoreMap(value map[string]any) map[string]any

RestoreMap is the map-preserving form of Restore.

Types

This section is empty.

Jump to

Keyboard shortcuts

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