helmette

package
v0.0.0-...-284ca22 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

package helmette implements golang analogs for the constructs present within the helm template rendering environment. See also: - https://helm.sh/docs/chart_template_guide/function_list/ - http://masterminds.github.io/sprig/ - https://pkg.go.dev/text/template

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atoi

func Atoi(in string) (int, error)

Atoi is the go equivalent of sprig's `atoi`.

func Coalesce

func Coalesce[T any](values ...T) T

Coalesce is the go equivalent of sprig's `coalesce`. +gotohelm:builtin=coalesce

func Concat

func Concat[T any](lists ...[]T) []T

Concat is the go equivalent of sprig's `concat`. +gotohelm:builtin=concat

func Default

func Default[T any](default_, value T) T

Default is a go equivalent of sprig's `default`. +gotohelm:builtin=default

func DictTest

func DictTest[K comparable, V any](m map[K]V, key K) (V, bool)

DictTest is an equivalent of `val, ok := map[key]` that is exercised as a function call rather than a special form of syntax. See also: "_shims.dicttest". func DictTest[K comparable, V any](m map[K]V, key K) TestResult[V] {

func Dig

func Dig(m map[string]any, fallback any, path ...string) any

Dig is a go equivalent of sprig's `dig`.

func Empty

func Empty(value any) bool

Empty is the go equivalent of sprig's `empty`. +gotohelm:builtin=empty

func Fail

func Fail(msg string)

Fail is the go equivalent of sprig's `fail`. +gotohelm:builtin=fail

func Float64

func Float64(in string) (float64, error)

func FromJSON

func FromJSON(data string) any

FromJSON is the go equivalent of sprig's `fromJson`. +gotohelm:builtin=fromJson

func HasKey

func HasKey[K comparable, V any](m map[K]V, key K) bool

HasKey is the go equivalent of sprig's `hasKey`. +gotohelm:builtin=hasKey

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys is the go equivalent of sprig's `keys`. +gotohelm:builtin=keys

func KindIs

func KindIs(kind string, v any) bool

KindIs is the go equivalent of sprig's `kindIs`. +gotohelm:builtin=kindIs

func KindOf

func KindOf(v any) string

KindOf is the go equivalent of sprig's `kindOf`. +gotohelm:builtin=kindOf

func Len

func Len(in any) int

+gotohelm:builtin=len

func Lower

func Lower(in string) string

Lower is the go equivalent of sprig's `lower`. +gotohelm:builtin=lower

func Merge

func Merge[K comparable, V any](sources ...map[K]V) map[K]V

Merge is a go equivalent of sprig's `merge`.

func MustDuration

func MustDuration(duration string) *metav1.Duration

func MustFromJSON

func MustFromJSON(data string) any

MustFromJSON is the go equivalent of sprig's `mustFromJson`. +gotohelm:builtin=mustFromJson

func MustRegexMatch

func MustRegexMatch(pattern, s string) bool

MustRegexMatch is the go equivalent of sprig's `mustRegexMatch`. +gotohelm:builtin=mustRegexMatch

func MustToJSON

func MustToJSON(value any) string

MustToJSON is the go equivalent of sprig's `mustToJson`. +gotohelm:builtin=mustToJson

func Printf

func Printf(format string, a ...any) string

Printf is the go equivalent of text/templates's `printf` +gotohelm:builtin=printf

func RegexMatch

func RegexMatch(pattern, s string) bool

RegexMatch is the go equivalent of sprig's `regexMatch`. +gotohelm:builtin=regexMatch

func Required

func Required(msg string, value any)

Required is the go equivalent of sprig's `required`. +gotohelm:builtin=required

func SortAlpha

func SortAlpha(x []string)

SortAlpha is the go equivalent of sprig's `sortAlpha` +gotohelm:builtin=sortAlpha

func ToJSON

func ToJSON(value any) string

ToJSON is the go equivalent of sprig's `toJson`. +gotohelm:builtin=toJson

func TrimPrefix

func TrimPrefix(prefix, s string) string

TrimPrefix is the go equivalent of sprig's `trimPrefix` +gotohelm:builtin=trimPrefix

func Trunc

func Trunc(length int, in string) string

Trunc is a go equivalent of sprig's `trunc`. +gotohelm:builtin=trunc

func TypeAssertion

func TypeAssertion[T any](val any) T

TypeAssertion is an equivalent of `x.(type)` that is exercised as a function call rather than a special form of syntax. See also: "_shims.typeassertion".

func TypeIs

func TypeIs(typ string, v any) bool

KindIs is the go equivalent of sprig's `typeIs`. +gotohelm:builtin=typeIs

func TypeOf

func TypeOf(v any) string

TypeOf is the go equivalent of sprig's `typeOf`. +gotohelm:builtin=typeOf

func TypeTest

func TypeTest[T any](val any) (T, bool)

TypeTest is an equivalent of `val, ok := x.(type)` that is exercised as a function call rather than a special form of syntax. See also: "_shims.typetest".

func Unset

func Unset[K comparable, V any](d map[K]V, key K)

Unset is the go equivalent of sprig's `unset`. +gotohelm:builtin=unset

func Unwrap

func Unwrap[T any](from Values) T

Unwrap "unwraps" .Values into a golang struct. DANGER: Unwrap performs no defaulting or validation. At the helm level, this is transpiled into .Values.AsMap. Callers are responsible for verifying that T is appropriately validated by the charts values.json.schema.

func Upper

func Upper(in string) string

Upper is the go equivalent of sprig's `upper`. +gotohelm:builtin=upper

Types

type Chart

type Chart struct {
	Name       string
	Version    string
	AppVersion string
}

type Dot

type Dot struct {
	Values  Values
	Release Release
	Chart   Chart
}

Dot is a representation of the "global" context or `.` in the execution of a helm template. See also: https://github.com/helm/helm/blob/3764b483b385a12e7d3765bff38eced840362049/pkg/chartutil/values.go#L137-L166

type Release

type Release struct {
	Name      string
	Namespace string
	Service   string
	IsUpgrade bool
	IsInstall bool
}

type Tuple2

type Tuple2[T1, T2 any] struct {
	T1 T1
	T2 T2
}

func Compact2

func Compact2[T1, T2 any](t1 T1, t2 T2) Tuple2[T1, T2]

type Tuple3

type Tuple3[T1, T2, T3 any] struct {
	T1 T1
	T2 T2
	T3 T3
}

func Compact3

func Compact3[T1, T2, T3 any](t1 T1, t2 T2, t3 T3) Tuple3[T1, T2, T3]

type Values

type Values map[string]any

func (Values) AsMap

func (v Values) AsMap() map[string]any

Jump to

Keyboard shortcuts

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