assets

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 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,
	"indentNext": IndentNext,
	"toBytes":    ToBytes,
	"toBase64":   ToBase64,
	"map":        MakeMap,
	"repeat":     Repeat,
	"isTrue":     IsTrue,
}

Functions

func Decode added in v1.9.0

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

func Indent added in v1.12.0

func Indent(spaceCount int, s string) string

func IndentNext added in v1.12.0

func IndentNext(spaceCount int, s string) string

func IsTrue added in v1.12.0

func IsTrue(v *bool) bool

func MakeMap added in v1.12.0

func MakeMap(kvs ...any) (map[any]any, error)

func MarshalYAML added in v1.12.0

func MarshalYAML(v any) (string, error)

func NIndent added in v1.12.0

func NIndent(spaceCount int, s string) string

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)

func Repeat added in v1.12.0

func Repeat(s string, count int) string

func ToBase64 added in v1.12.0

func ToBase64(data []byte) string

func ToBytes added in v1.12.0

func ToBytes(s string) []byte

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