template

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SplitPipelineKey       = "split"
	StrArrIndexPipelineKey = "index"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedTemplate

type AdvancedTemplate struct {
	*template.Template
	// contains filtered or unexported fields
}

func New

func New() *AdvancedTemplate

New news an AdvancedTemplate instance.

func (*AdvancedTemplate) RegisterFunc

func (at *AdvancedTemplate) RegisterFunc(key string, customFunc interface{}) error

RegisterFunc register a customized functionality with key to AdvancedTemplate. If the functionality key is already existed, the relative function will be override.

func (*AdvancedTemplate) Render

func (at *AdvancedTemplate) Render(tmpl string, vars interface{}) (string, error)

Render fills the source template string with variables struct like helm.

func (*AdvancedTemplate) RenderTo

func (at *AdvancedTemplate) RenderTo(w io.Writer, tmpl string, vars interface{}) (int, error)

RenderTo fills the source template string with variables struct and writes content to io.Writer.

Jump to

Keyboard shortcuts

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