package strvals
import "helm.sh/helm/v3/pkg/strvals"
Package strvals provides tools for working with strval lines.
Helm supports a compressed format for YAML settings which we call strvals. The format is roughly like this:
name=value,topname.subname=value
The above is equivalent to the YAML document
name: value topname: subname: value
This package provides a parser and utilities for converting the strvals format to other formats.
Index ¶
- Variables
- func Parse(s string) (map[string]interface{}, error)
- func ParseFile(s string, reader RunesValueReader) (map[string]interface{}, error)
- func ParseInto(s string, dest map[string]interface{}) error
- func ParseIntoFile(s string, dest map[string]interface{}, reader RunesValueReader) error
- func ParseIntoString(s string, dest map[string]interface{}) error
- func ParseJSON(s string, dest map[string]interface{}) error
- func ParseLiteral(s string) (map[string]interface{}, error)
- func ParseLiteralInto(s string, dest map[string]interface{}) error
- func ParseString(s string) (map[string]interface{}, error)
- func ToYAML(s string) (string, error)
- type RunesValueReader
Variables ¶
ErrNotList indicates that a non-list was treated as a list.
var MaxIndex = 65536
MaxIndex is the maximum index that will be allowed by setIndex. The default value 65536 = 1024 * 64
var MaxNestedNameLevel = 30
MaxNestedNameLevel is the maximum level of nesting for a value name that will be allowed.
Functions ¶
func Parse ¶
Parse parses a set line.
A set line is of the form name1=value1,name2=value2
func ParseFile ¶
func ParseFile(s string, reader RunesValueReader) (map[string]interface{}, error)
ParseFile parses a set line, but its final value is loaded from the file at the path specified by the original value.
A set line is of the form name1=path1,name2=path2
When the files at path1 and path2 contained "val1" and "val2" respectively, the set line is consumed as name1=val1,name2=val2
func ParseInto ¶
ParseInto parses a strvals line and merges the result into dest.
If the strval string has a key that exists in dest, it overwrites the dest version.
func ParseIntoFile ¶
func ParseIntoFile(s string, dest map[string]interface{}, reader RunesValueReader) error
ParseIntoFile parses a filevals line and merges the result into dest.
This method always returns a string as the value.
func ParseIntoString ¶
ParseIntoString parses a strvals line and merges the result into dest.
This method always returns a string as the value.
func ParseJSON ¶
ParseJSON parses a string with format key1=val1, key2=val2, ... where values are json strings (null, or scalars, or arrays, or objects). An empty val is treated as null.
If a key exists in dest, the new value overwrites the dest version.
func ParseLiteral ¶
ParseLiteral parses a set line interpreting the value as a literal string.
A set line is of the form name1=value1
func ParseLiteralInto ¶
ParseLiteralInto parses a strvals line and merges the result into dest. The value is interpreted as a literal string.
If the strval string has a key that exists in dest, it overwrites the dest version.
func ParseString ¶
ParseString parses a set line and forces a string value.
A set line is of the form name1=value1,name2=value2
func ToYAML ¶
ToYAML takes a string of arguments and converts to a YAML document.
Types ¶
type RunesValueReader ¶
RunesValueReader is a function that takes the given value (a slice of runes) and returns the parsed value
Source Files ¶
doc.go literal_parser.go parser.go
- Version
- v3.17.3 (latest)
- Published
- Apr 9, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 1 month ago –
Tools for package owners.