functions

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 7

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

func SetSubTemplateVariables(m map[string]any)

SetSubTemplateVariables sets variables to apply in `tplexec` function

func WithAll added in v1.1.0

func WithAll(fm template.FuncMap)

WithAll includes all available Sprig and Korvike functions in the function map.

func WithKorvikeAll added in v1.1.0

func WithKorvikeAll(fm template.FuncMap)

WithKorvikeAll includes all Korvike functions in the function map.

func WithKorvikeSafe added in v1.1.0

func WithKorvikeSafe(fm template.FuncMap)

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.

func WithSafe added in v1.1.0

func WithSafe(fm template.FuncMap)

WithSafe includes Sprig's hermetic functions and Korvike functions safe for untrusted templates.

Types

type FuncMapOpt added in v1.1.0

type FuncMapOpt func(template.FuncMap)

FuncMapOpt adds a group of functions to a function map.

Jump to

Keyboard shortcuts

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