translate

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data, codec string) (any, error)

Decode decodes the raw, yaml/json, toml and returns the result.

func Execute

func Execute(v any, tmp TemplateExecuter) ([]byte, error)

Execute executes the template with the given data.

func SetGlobalTemplate

func SetGlobalTemplate(t *Template)

Types

type Template

type Template struct {
	TXT  *textTemplate.Template
	HTML *htmlTemplate.Template

	FuncSprig     textTemplate.FuncMap
	FuncSprigHtml htmlTemplate.FuncMap
	FuncHelm      func(*textTemplate.Template) textTemplate.FuncMap
}
var GlobalTemplate *Template

func NewTemplate

func NewTemplate() *Template

func (Template) Ext

func (t Template) Ext(value any, templateValue string, templateType Tmp, funcList string) ([]byte, error)

type TemplateExecuter

type TemplateExecuter interface {
	Execute(wr io.Writer, data any) error
}

type Tmp

type Tmp int
const (
	TXT Tmp = iota
	HTML
)

Directories

Path Synopsis
templates
helm
These functions copied from https://github.com/helm/helm/blob/main/pkg/engine/funcs.go
These functions copied from https://github.com/helm/helm/blob/main/pkg/engine/funcs.go

Jump to

Keyboard shortcuts

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