util

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HumanReadableEvalError added in v1.4.3

func HumanReadableEvalError(err error) error

HumanReadableEvalError takes an error object returned by `starlark.Call` function, convert the error message to include stacktrace. If an error of any other type is passed in, it ignores and return the error object unmodified.

func LoadFilterFile added in v1.1.0

func LoadFilterFile(filePath string) ([]string, error)

LoadFilterFile parses a file into an array of non-empty, non-comment lines. If the file does not exist, then os.IsNotExist(err) == true

func ParseCommaSeparatedParams

func ParseCommaSeparatedParams(params string) (map[string]string, error)

ParseCommaSeparatedParams slipts params in the form of "foo=bar,baz=qux" in to a map {"foo": "bar", "baz": "qux"}

func ValueFromJSON

func ValueFromJSON(v interface{}) (starlark.Value, error)

ValueFromJSON converts JSON value to starlark.Value.

func ValueFromNestedMap

func ValueFromNestedMap(m map[string]interface{}) (starlark.Value, error)

ValueFromNestedMap converts nested JSON map oject to starlark.Value.

Types

type StringsFlagValue added in v1.1.0

type StringsFlagValue []string

func StringsFlag added in v1.1.0

func StringsFlag(name string, value []string, usage string) *StringsFlagValue

func (*StringsFlagValue) Set added in v1.1.0

func (s *StringsFlagValue) Set(value string) error

func (*StringsFlagValue) String added in v1.1.0

func (s *StringsFlagValue) String() string

Jump to

Keyboard shortcuts

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