builtinvar

package
v0.10.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package builtinvar deals with so-called "built in vars". These are vars that are prefixed with an underscore and are automatically provided by abc. Examples are _git_tag and _flag_dest.

Index

Constants

View Source
const (
	// The _git_* vars are in scope if and only if api_version>=v1beta3. They
	// may in-scope-but-empty-string if the template source is not a git repo.
	GitTag      = "_git_tag"
	GitSHA      = "_git_sha"
	GitShortSHA = "_git_short_sha"

	// NowMilliseconds is the Unix millisecond timestamp (as a string) of
	// template execution time (aka "today's datetime").
	NowMilliseconds = "_now_ms"

	// The value of the --dest flag (the render output directory).
	FlagDest = "_flag_dest"

	// The positional argument on the command line providing the template to be
	// rendered.
	FlagSource = "_flag_source"
)

These are the so-called "built-in" variable names that can be used in spec.yaml. Not all variables are always in scope; it depends on the api_version and the location within the spec file.

Variables

This section is empty.

Functions

func NamesInScope

func NamesInScope(f features.Features) []string

NamesInScope returns the set of builtin var names.

func Validate

func Validate(f features.Features, attemptedNames []string) error

Validate returns error if any of the attemptedNames are not valid builtin var names. The "features" parameter is derived from the api_version, and it's needed because the set of variable names that are in scope depends on the api_version; we sometimes add new variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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