assets

package
v1.11.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFuncs template.FuncMap = template.FuncMap{
	"toYAML":   marshalYAML,
	"indent":   indent,
	"nindent":  nindent,
	"toBytes":  toBytes,
	"toBase64": toBase64,
}

Functions

func Decode added in v1.9.0

func Decode[T any](data []byte, decoder runtime.Decoder) (T, error)

func RenderAndDecode added in v1.9.0

func RenderAndDecode[T runtime.Object](tmpl *template.Template, inputs any, decoder runtime.Decoder) (T, string, error)

func RenderTemplate

func RenderTemplate(tmpl *template.Template, inputs any) ([]byte, error)

Types

type ObjectTemplate added in v1.9.0

type ObjectTemplate[T runtime.Object] struct {
	// contains filtered or unexported fields
}

func ParseObjectTemplate added in v1.9.0

func ParseObjectTemplate[T runtime.Object](name, tmplString string, funcMap template.FuncMap, decoder runtime.Decoder) (ObjectTemplate[T], error)

func ParseObjectTemplateOrDie added in v1.9.0

func ParseObjectTemplateOrDie[T runtime.Object](name, tmplString string, funcMap template.FuncMap, decoder runtime.Decoder) ObjectTemplate[T]

func (*ObjectTemplate[T]) RenderObject added in v1.9.0

func (t *ObjectTemplate[T]) RenderObject(inputs any) (T, string, error)

Jump to

Keyboard shortcuts

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