render

package
v0.19.769 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsurePrefix

func EnsurePrefix(data map[string]interface{}) map[string]interface{}

func Exists

func Exists(path string, data map[string]interface{}) bool

func Render

func Render(inputVal string, data map[string]interface{}) (string, error)

This method is being deprecated, in favor of the more thorough render methods we have introduced

func RenderMap

func RenderMap(obj any, data map[string]any) error

func RenderString

func RenderString(inputVal string, intermediateData *structpb.Struct) (string, error)

func RenderStruct

func RenderStruct(obj any, data map[string]any) error

want to write a type that can walk an object recursively and any field that has a struct

func RenderV2

func RenderV2(inputVal string, data map[string]interface{}) (string, error)

func RenderVar

func RenderVar(v Var, data map[string]interface{}) (string, error)

func RenderWithWarnings

func RenderWithWarnings(inputVal string, data map[string]interface{}) (string, []error, error)

RenderWithWarnings walks through the template variable by variable and will return well formed errors for any partial that was "unrenderable".

Types

type RenderErr

type RenderErr struct {
	Name     string
	Template string
	Err      error
}

func (RenderErr) Error

func (r RenderErr) Error() string

func (RenderErr) Unwrap

func (r RenderErr) Unwrap() error

type Var

type Var struct {
	Template string
	Name     string
}

func Parse

func Parse(str string) []Var

Parse returns a list of all the template uses in a string, which allows for better rendering in the case of errors. NOTE: this can _not_ be used to reconstruct the original template using strings.Join() as any actual content will be removed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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