mirror of
https://github.com/mudler/luet.git
synced 2025-09-01 07:09:13 +00:00
This reverts commit db8e3da01f
.
This commit is contained in:
committed by
GitHub
parent
db8e3da01f
commit
f8350a2f07
45
vendor/github.com/Masterminds/sprig/v3/functions.go
generated
vendored
45
vendor/github.com/Masterminds/sprig/v3/functions.go
generated
vendored
@@ -3,10 +3,8 @@ package sprig
|
||||
import (
|
||||
"errors"
|
||||
"html/template"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -15,7 +13,6 @@ import (
|
||||
|
||||
util "github.com/Masterminds/goutils"
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
// FuncMap produces the function map.
|
||||
@@ -83,7 +80,6 @@ var nonhermeticFunctions = []string{
|
||||
"randAlpha",
|
||||
"randAscii",
|
||||
"randNumeric",
|
||||
"randBytes",
|
||||
"uuidv4",
|
||||
|
||||
// OS
|
||||
@@ -204,28 +200,9 @@ var genericMap = map[string]interface{}{
|
||||
}
|
||||
return val
|
||||
},
|
||||
"randInt": func(min, max int) int { return rand.Intn(max-min) + min },
|
||||
"add1f": func(i interface{}) float64 {
|
||||
return execDecimalOp(i, []interface{}{1}, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Add(d2) })
|
||||
},
|
||||
"addf": func(i ...interface{}) float64 {
|
||||
a := interface{}(float64(0))
|
||||
return execDecimalOp(a, i, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Add(d2) })
|
||||
},
|
||||
"subf": func(a interface{}, v ...interface{}) float64 {
|
||||
return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Sub(d2) })
|
||||
},
|
||||
"divf": func(a interface{}, v ...interface{}) float64 {
|
||||
return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Div(d2) })
|
||||
},
|
||||
"mulf": func(a interface{}, v ...interface{}) float64 {
|
||||
return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Mul(d2) })
|
||||
},
|
||||
"biggest": max,
|
||||
"max": max,
|
||||
"min": min,
|
||||
"maxf": maxf,
|
||||
"minf": minf,
|
||||
"ceil": ceil,
|
||||
"floor": floor,
|
||||
"round": round,
|
||||
@@ -239,15 +216,11 @@ var genericMap = map[string]interface{}{
|
||||
"default": dfault,
|
||||
"empty": empty,
|
||||
"coalesce": coalesce,
|
||||
"all": all,
|
||||
"any": any,
|
||||
"compact": compact,
|
||||
"mustCompact": mustCompact,
|
||||
"fromJson": fromJson,
|
||||
"toJson": toJson,
|
||||
"toPrettyJson": toPrettyJson,
|
||||
"toRawJson": toRawJson,
|
||||
"mustFromJson": mustFromJson,
|
||||
"mustToJson": mustToJson,
|
||||
"mustToPrettyJson": mustToPrettyJson,
|
||||
"mustToRawJson": mustToRawJson,
|
||||
@@ -270,20 +243,13 @@ var genericMap = map[string]interface{}{
|
||||
// Network:
|
||||
"getHostByName": getHostByName,
|
||||
|
||||
// Paths:
|
||||
// File Paths:
|
||||
"base": path.Base,
|
||||
"dir": path.Dir,
|
||||
"clean": path.Clean,
|
||||
"ext": path.Ext,
|
||||
"isAbs": path.IsAbs,
|
||||
|
||||
// Filepaths:
|
||||
"osBase": filepath.Base,
|
||||
"osClean": filepath.Clean,
|
||||
"osDir": filepath.Dir,
|
||||
"osExt": filepath.Ext,
|
||||
"osIsAbs": filepath.IsAbs,
|
||||
|
||||
// Encoding:
|
||||
"b64enc": base64encode,
|
||||
"b64dec": base64decode,
|
||||
@@ -331,25 +297,17 @@ var genericMap = map[string]interface{}{
|
||||
"slice": slice,
|
||||
"mustSlice": mustSlice,
|
||||
"concat": concat,
|
||||
"dig": dig,
|
||||
"chunk": chunk,
|
||||
"mustChunk": mustChunk,
|
||||
|
||||
// Crypto:
|
||||
"bcrypt": bcrypt,
|
||||
"htpasswd": htpasswd,
|
||||
"genPrivateKey": generatePrivateKey,
|
||||
"derivePassword": derivePassword,
|
||||
"buildCustomCert": buildCustomCertificate,
|
||||
"genCA": generateCertificateAuthority,
|
||||
"genCAWithKey": generateCertificateAuthorityWithPEMKey,
|
||||
"genSelfSignedCert": generateSelfSignedCertificate,
|
||||
"genSelfSignedCertWithKey": generateSelfSignedCertificateWithPEMKey,
|
||||
"genSignedCert": generateSignedCertificate,
|
||||
"genSignedCertWithKey": generateSignedCertificateWithPEMKey,
|
||||
"encryptAES": encryptAES,
|
||||
"decryptAES": decryptAES,
|
||||
"randBytes": randBytes,
|
||||
|
||||
// UUIDs:
|
||||
"uuidv4": uuidv4,
|
||||
@@ -374,7 +332,6 @@ var genericMap = map[string]interface{}{
|
||||
"mustRegexReplaceAllLiteral": mustRegexReplaceAllLiteral,
|
||||
"regexSplit": regexSplit,
|
||||
"mustRegexSplit": mustRegexSplit,
|
||||
"regexQuoteMeta": regexQuoteMeta,
|
||||
|
||||
// URLs:
|
||||
"urlParse": urlParse,
|
||||
|
Reference in New Issue
Block a user