value

package
v0.12.8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Helper functions for doing value conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsString added in v0.10.18

func AsString(x starlark.Value) (string, bool)

Wrapper around starlark.AsString

func AsStringOrStringList added in v0.10.18

func AsStringOrStringList(x starlark.Value) ([]string, bool)

Unpack an argument that can either be expressed as a string or as a list of strings.

func SequenceToStringSlice added in v0.10.15

func SequenceToStringSlice(seq starlark.Sequence) ([]string, error)

func StringSliceToList added in v0.10.22

func StringSliceToList(slice []string) *starlark.List

func ValueOrSequenceToSlice

func ValueOrSequenceToSlice(v starlark.Value) []starlark.Value

If `v` is a `starlark.Sequence`, return a slice of its elements Otherwise, return it as a single-element slice For functions that take `Union[List[T], T]`

func ValueToAbsPath added in v0.10.15

func ValueToAbsPath(thread *starlark.Thread, v starlark.Value) (string, error)

func ValueToCmd added in v0.12.0

func ValueToCmd(v starlark.Value) (model.Cmd, error)

provides dockerfile-style behavior of: a string gets interpreted as a shell command (like, sh -c 'foo bar $X') an array of strings gets interpreted as a raw argv to exec

func ValueToStringMap added in v0.10.18

func ValueToStringMap(v starlark.Value) (map[string]string, error)

Types

type ImplicitStringer added in v0.10.18

type ImplicitStringer interface {
	ImplicitString() string
}

type PathMaker added in v0.10.15

type PathMaker interface {
	MakeLocalPath(relPath string) string
}

Jump to

Keyboard shortcuts

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