sprig

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Sprig: Template functions for Go.

This package contains a number of utility functions for working with data inside of Go `html/template` and `text/template` files.

To add these functions, use the `template.Funcs()` method:

t := templates.New("foo").Funcs(sprig.FuncMap())

Note that you should add the function map before you parse any template files.

In several cases, Sprig reverses the order of arguments from the way they
appear in the standard library. This is to make it easier to pipe
arguments into functions.

See http://masterminds.github.io/sprig/ for more detailed documentation on each of the available functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

Produce the function map.

Use this to pass the functions into the template engine:

tpl := template.New("foo").Funcs(sprig.FuncMap()))

func GenericFuncMap

func GenericFuncMap() map[string]interface{}

GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.

func HermeticHtmlFuncMap

func HermeticHtmlFuncMap() template.FuncMap

HermeticHtmlFuncMap returns an 'html/template'.Funcmap with only repeatable functions.

func HermeticTxtFuncMap

func HermeticTxtFuncMap() ttemplate.FuncMap

HermeticTxtFuncMap returns a 'text/template'.FuncMap with only repeatable functions.

func HtmlFuncMap

func HtmlFuncMap() template.FuncMap

HtmlFuncMap returns an 'html/template'.Funcmap

func TxtFuncMap

func TxtFuncMap() ttemplate.FuncMap

TxtFuncMap returns a 'text/template'.FuncMap

Types

type DSAKeyFormat

type DSAKeyFormat struct {
	Version       int
	P, Q, G, Y, X *big.Int
}

Jump to

Keyboard shortcuts

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