gotemplate

package
v0.8.0-beta.31 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultDSL DSLType = "gotemplate"
	KBDSL      DSLType = "kbdsl"
	KBDSL2     DSLType = "kbdsl2"

	TemplateBeginDelim = "{{"
	TemplateEndDelim   = "}}"
	KBDSLBeginDelim    = "{%"
	KBDSLEndDelim      = "%}"
	KBDSL2BeginDelim   = "<%"
	KBDSL2EndDelim     = "%>"
)
View Source
const (
	DefaultTemplateOps = "missingkey=error"
)
View Source
const (
	GoTemplateLibraryAnnotationKey = "config.kubeblocks.io/go-template-library"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltInObjectsFunc

type BuiltInObjectsFunc map[string]interface{}

type DSLType

type DSLType string

type TplEngine

type TplEngine struct {
	// contains filtered or unexported fields
}

func NewTplEngine

func NewTplEngine(values *TplValues, funcs *BuiltInObjectsFunc, tplName string, cli client.Reader, ctx context.Context, options ...TplEngineOptions) *TplEngine

NewTplEngine creates go template helper

func (*TplEngine) GetTplEngine

func (t *TplEngine) GetTplEngine() *template.Template

func (*TplEngine) Render

func (t *TplEngine) Render(context string) (string, error)

type TplEngineOptions

type TplEngineOptions func(*TplEngine)

func WithCustomizedSyntax

func WithCustomizedSyntax(begin, end string) TplEngineOptions

func WithCustomizedWithType

func WithCustomizedWithType(dsl DSLType) TplEngineOptions

type TplValues

type TplValues map[string]interface{}

func ConstructFunctionArgList

func ConstructFunctionArgList(args ...interface{}) TplValues

Jump to

Keyboard shortcuts

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