templates

package
v0.30.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(text string, data interface{}) (bool, error)

func DockerServerVersionCompare added in v0.19.2

func DockerServerVersionCompare(a, b string) int

func Duration added in v0.25.0

func Duration(v interface{}) time.Duration

func Error

func Error(name string, err error) error

Error will wrap a template error in an ExecError causing template.Execute to recover.

func Execute

func Execute(text string, data interface{}) (string, error)

func FormatQuantity

func FormatQuantity(value int, args ...string) string

func IsFuncError

func IsFuncError(err error) bool

func JSONQuery

func JSONQuery(obj, exp string) []interface{}

func JqMessagesToString

func JqMessagesToString(msgs []interface{}) string

func JqMessagesToStringSlice

func JqMessagesToStringSlice(msgs []interface{}) []string

func Panic

func Panic(name string, err error) error

Panic will panic with a recoverable error.

func ParseQuantity

func ParseQuantity(str string) int

func RegisterFunc

func RegisterFunc(key string, fn interface{})

func Seconds added in v0.25.0

func Seconds(v interface{}) time.Duration

func SemverCompare

func SemverCompare(a, b string) int

func String

func String(text string, data interface{}) (string, error)

func SumQuantities

func SumQuantities(ii []string) int

Types

type FuncError

type FuncError struct {
	Name string // Name of function.
	Err  error  // Pre-formatted error.
}

func (FuncError) Error

func (e FuncError) Error() string

Jump to

Keyboard shortcuts

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