strvals

package
v0.1.109 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 7 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

Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).

Index

Constants

This section is empty.

Variables

View Source
var ErrNotList = errors.New("not a list")

ErrNotList indicates that a non-list was treated as a list.

Functions

func Parse

func Parse(s string) (map[string]interface{}, error)

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

func ParseInto(s string, dest map[string]interface{}) error

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

func ParseIntoString(s string, dest map[string]interface{}) error

ParseIntoString parses a strvals line and merges the result into dest.

This method always returns a string as the value.

func ParseString

func ParseString(s string) (map[string]interface{}, error)

ParseString parses a set line and forces a string value.

A set line is of the form name1=value1,name2=value2 .

func ToYAML

func ToYAML(s string) (string, error)

ToYAML takes a string of arguments and converts to a YAML document.

Types

type RunesValueReader

type RunesValueReader func([]rune) (interface{}, error)

RunesValueReader is a function that takes the given value (a slice of runes) and returns the parsed value.

Jump to

Keyboard shortcuts

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