ktemplate

package
v0.31.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delims added in v0.24.0

type Delims struct {
	Left, Right string
}

type Functions

type Functions struct {
	RightDelim, LeftDelim string
	Custom                template.FuncMap
	// contains filtered or unexported fields
}

func NewFunctions

func NewFunctions(clientset *kubernetes.Clientset) *Functions

func (*Functions) FuncMap

func (f *Functions) FuncMap() template.FuncMap

func (*Functions) JSONPath

func (f *Functions) JSONPath(object interface{}, jsonpath string) string

func (*Functions) KGet

func (f *Functions) KGet(path, jsonpath string) string

func (*Functions) ParseMarkdownTables added in v0.23.0

func (f *Functions) ParseMarkdownTables(input string) []MarkdownTable

func (*Functions) Template

func (f *Functions) Template(template string, vars interface{}) (string, error)

Template templates out a template using gomplate

type MarkdownTable added in v0.23.0

type MarkdownTable struct {
	Columns []string   `json:"columns"`
	Rows    [][]string `json:"rows"`
}

type StructTemplater

type StructTemplater struct {
	Values    map[string]interface{}
	Clientset *kubernetes.Clientset

	// IgnoreFields from walking where key is field name and value is field type
	IgnoreFields map[string]string
	Funcs        template.FuncMap
	DelimSets    []Delims
	// If specified create a function for each value so that is can be accessed via {{ value }} in addition to {{ .value }}
	ValueFunctions bool
	RequiredTag    string
	// contains filtered or unexported fields
}

func (StructTemplater) Struct

func (w StructTemplater) Struct(reflect.Value) error

this func is required to fulfil the reflectwalk.StructWalker interface

func (StructTemplater) StructField

func (w StructTemplater) StructField(f reflect.StructField, v reflect.Value) error

func (StructTemplater) Template

func (w StructTemplater) Template(val string) (string, error)

func (StructTemplater) Walk added in v0.24.0

func (w StructTemplater) Walk(object interface{}) error

Jump to

Keyboard shortcuts

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