literalsource

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 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 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