subst

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package subst does string substituion in build fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubstituteBuildFields

func SubstituteBuildFields(b *cb.Build) error

SubstituteBuildFields does an in-place string substitution of build parameters. User-defined substitutions are also accepted. If a built-in substitution value is not defined (perhaps a sourceless build, or storage source), then the corresponding substitutions will result in an empty string.

Types

type TemplateParameter

type TemplateParameter struct {
	Start, End int
	Key        string
	Escape     bool // if true, this parameter is `$$`
}

TemplateParameter represents the position of a Key in a string.

func FindTemplateParameters

func FindTemplateParameters(input string) []*TemplateParameter

FindTemplateParameters finds all the parameters in the string `input`, which are not escaped, and returns an array.

Jump to

Keyboard shortcuts

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