Documentation
¶
Overview ¶
Package functions contains custom functions specific to korvike and returns the sprig functions with added korvike specific functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunctionMap ¶
func GetFunctionMap(opts ...FuncMapOpt) template.FuncMap
GetFunctionMap exports all functions used in korvike to be used in own projects Example:
import korvike "github.com/Luzifer/korvike"
tpl := template.New("mytemplate").Funcs(korvike.GetFunctionMap())
func SetSubTemplateVariables ¶ added in v0.11.0
SetSubTemplateVariables sets variables to apply in `tplexec` function
func WithAll ¶ added in v1.1.0
WithAll includes all available Sprig and Korvike functions in the function map.
func WithKorvikeAll ¶ added in v1.1.0
WithKorvikeAll includes all Korvike functions in the function map.
func WithKorvikeSafe ¶ added in v1.1.0
WithKorvikeSafe includes only Korvike functions safe for untrusted templates.
Safe functions must not allow template authors to read host files, access secrets, execute nested templates with broader privileges, perform network access, mutate process state, or otherwise gain capabilities beyond pure data formatting and transformation.
Types ¶
type FuncMapOpt ¶ added in v1.1.0
FuncMapOpt adds a group of functions to a function map.