Documentation ¶
Overview ¶
Helper functions for doing value conversions.
Index ¶
- func AsString(x starlark.Value) (string, bool)
- func SequenceToStringSlice(seq starlark.Sequence) ([]string, error)
- func StringSliceToList(slice []string) *starlark.List
- func ValueGroupToCmdHelper(cmdVal, cmdBatVal starlark.Value) (model.Cmd, error)
- func ValueOrSequenceToSlice(v starlark.Value) []starlark.Value
- func ValueToAbsPath(thread *starlark.Thread, v starlark.Value) (string, error)
- func ValueToBatCmd(v starlark.Value) (model.Cmd, error)
- func ValueToHostCmd(v starlark.Value) (model.Cmd, error)
- func ValueToUnixCmd(v starlark.Value) (model.Cmd, error)
- type Duration
- type ImplicitStringer
- type LocalPath
- type LocalPathList
- type PathMaker
- type StringOrStringList
- type StringStringMap
- type Stringable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SequenceToStringSlice ¶ added in v0.10.15
func StringSliceToList ¶ added in v0.10.22
func ValueGroupToCmdHelper ¶ added in v0.14.0
In other similar build systems (Buck and Bazel), there's a "main" command, and then various per-platform overrides. https://docs.bazel.build/versions/master/be/general.html#genrule.cmd_bat This helper function abstracts out the precedence rules.
func ValueOrSequenceToSlice ¶
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 ValueToHostCmd ¶ added in v0.14.0
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
Types ¶
type Duration ¶ added in v0.15.1
Parse duration constants from starlark.
func (Duration) AsDuration ¶ added in v0.15.1
type ImplicitStringer ¶ added in v0.10.18
type ImplicitStringer interface {
ImplicitString() string
}
type LocalPath ¶ added in v0.17.5
type LocalPath struct { Value string // contains filtered or unexported fields }
func NewLocalPathUnpacker ¶ added in v0.17.5
type LocalPathList ¶ added in v0.17.11
type LocalPathList struct { Value []string // contains filtered or unexported fields }
func NewLocalPathListUnpacker ¶ added in v0.17.11
func NewLocalPathListUnpacker(t *starlark.Thread) LocalPathList
type StringOrStringList ¶ added in v0.16.0
type StringOrStringList struct {
Values []string
}
type StringStringMap ¶ added in v0.17.4
func (*StringStringMap) AsMap ¶ added in v0.17.4
func (s *StringStringMap) AsMap() map[string]string
type Stringable ¶ added in v0.17.2
type Stringable struct {
Value string
}