templateutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrefix

func AddPrefix(s, prefix, sep string) string

AddPrefix to each separated string elements

func AddSuffix

func AddSuffix(s, suffix, sep string) string

AddSuffix to each separated string elements

func CreateEmbeddedShellRunner

func CreateEmbeddedShellRunner(
	workingDir string,
	rc dukkha.RenderingContext,
	stdin io.Reader,
	stdout io.Writer,
	stderr io.Writer,
) (*interp.Runner, error)

func CreateTemplate

func CreateTemplate(rc dukkha.RenderingContext) *template.Template

func ExecCmdAsTemplateFuncCall

func ExecCmdAsTemplateFuncCall(
	rc dukkha.RenderingContext,
	stdin io.Reader,
	stdout io.Writer,
	args []string,
) error

func RegisterTemplateFuncs

func RegisterTemplateFuncs(fm map[string]TemplateFuncFactory)

func RemovePrefix

func RemovePrefix(s, prefix, sep string) string

RemovePrefix of each separated string elements

func RemoveSuffix

func RemoveSuffix(s, suffix, sep string) string

func RunScriptInEmbeddedShell

func RunScriptInEmbeddedShell(
	ctx context.Context,
	runner *interp.Runner,
	parser *syntax.Parser,
	script string,
) error

func SetDefaultImageTagIfNoTagSet

func SetDefaultImageTagIfNoTagSet(
	rc dukkha.RenderingContext, imageName string, keepKernelInfo bool,
) string

func SetDefaultManifestTagIfNoTagSet

func SetDefaultManifestTagIfNoTagSet(
	rc dukkha.RenderingContext, manfiestName string,
) string

Types

type TemplateFuncFactory

type TemplateFuncFactory func(rc dukkha.RenderingContext) interface{}

Jump to

Keyboard shortcuts

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