Documentation ¶
Overview ¶
Package funcs is an internal package that provides gomplate namespaces and functions to be used in 'text/template' templates.
The different namespaces can be added individually:
f := template.FuncMap{} for k, v := range funcs.CreateMathFuncs(ctx) { f[k] = v } for k, v := range funcs.CreateNetFuncs(ctx) { f[k] = v }
Even though the functions are exported, these are not intended to be called programmatically by external consumers, but instead only to be used as template functions.
Deprecated: This package will be made internal in a future major version.
Index ¶
- func AWSFuncs(f map[string]interface{})deprecated
- func AddBase64Funcs(f map[string]interface{})deprecated
- func AddCollFuncs(f map[string]interface{})deprecated
- func AddConvFuncs(f map[string]interface{})deprecated
- func AddCryptoFuncs(f map[string]interface{})deprecated
- func AddDataFuncs(f map[string]interface{}, d *data.Data)deprecated
- func AddEnvFuncs(f map[string]interface{})deprecated
- func AddFileFuncs(f map[string]interface{})deprecated
- func AddFilePathFuncs(f map[string]interface{})deprecated
- func AddGCPFuncs(f map[string]interface{})deprecated
- func AddMathFuncs(f map[string]interface{})deprecated
- func AddNetFuncs(f map[string]interface{})deprecated
- func AddPathFuncs(f map[string]interface{})deprecated
- func AddRandomFuncs(f map[string]interface{})deprecated
- func AddReFuncs(f map[string]interface{})deprecated
- func AddSockaddrFuncs(f map[string]interface{})deprecated
- func AddStringFuncs(f map[string]interface{})deprecated
- func AddTestFuncs(f map[string]interface{})deprecated
- func AddTimeFuncs(f map[string]interface{})deprecated
- func AddUUIDFuncs(f map[string]interface{})deprecated
- func CreateAWSFuncs(ctx context.Context) map[string]interface{}
- func CreateBase64Funcs(ctx context.Context) map[string]interface{}
- func CreateCollFuncs(ctx context.Context) map[string]interface{}
- func CreateConvFuncs(ctx context.Context) map[string]interface{}
- func CreateCryptoFuncs(ctx context.Context) map[string]interface{}
- func CreateDataFuncs(ctx context.Context, d *data.Data) map[string]interface{}
- func CreateEnvFuncs(ctx context.Context) map[string]interface{}
- func CreateFileFuncs(ctx context.Context) map[string]interface{}
- func CreateFilePathFuncs(ctx context.Context) map[string]interface{}
- func CreateGCPFuncs(ctx context.Context) map[string]interface{}
- func CreateMathFuncs(ctx context.Context) map[string]interface{}
- func CreateNetFuncs(ctx context.Context) map[string]interface{}
- func CreatePathFuncs(ctx context.Context) map[string]interface{}
- func CreateRandomFuncs(ctx context.Context) map[string]interface{}
- func CreateReFuncs(ctx context.Context) map[string]interface{}
- func CreateSemverFuncs(ctx context.Context) map[string]interface{}
- func CreateSockaddrFuncs(ctx context.Context) map[string]interface{}
- func CreateStringFuncs(ctx context.Context) map[string]interface{}
- func CreateTestFuncs(ctx context.Context) map[string]interface{}
- func CreateTimeFuncs(ctx context.Context) map[string]interface{}
- func CreateUUIDFuncs(ctx context.Context) map[string]interface{}
- type Base64Funcs
- func Base64NS() *Base64Funcsdeprecated
- type CollFuncs
- func CollNS() *CollFuncsdeprecated
- func (CollFuncs) Append(v interface{}, list interface{}) ([]interface{}, error)
- func (CollFuncs) Dict(in ...interface{}) (map[string]interface{}, error)
- func (CollFuncs) Flatten(args ...interface{}) ([]interface{}, error)
- func (CollFuncs) GoSlice(item reflect.Value, indexes ...reflect.Value) (reflect.Value, error)
- func (CollFuncs) Has(in interface{}, key string) bool
- func (CollFuncs) Index(args ...interface{}) (interface{}, error)
- func (f *CollFuncs) JQ(jqExpr string, in interface{}) (interface{}, error)
- func (CollFuncs) JSONPath(p string, in interface{}) (interface{}, error)
- func (CollFuncs) Keys(in ...map[string]interface{}) ([]string, error)
- func (CollFuncs) Merge(dst map[string]interface{}, src ...map[string]interface{}) (map[string]interface{}, error)
- func (CollFuncs) Omit(args ...interface{}) (map[string]interface{}, error)
- func (CollFuncs) Pick(args ...interface{}) (map[string]interface{}, error)
- func (CollFuncs) Prepend(v interface{}, list interface{}) ([]interface{}, error)
- func (CollFuncs) Reverse(in interface{}) ([]interface{}, error)
- func (CollFuncs) Slice(args ...interface{}) []interface{}
- func (CollFuncs) Sort(args ...interface{}) ([]interface{}, error)
- func (CollFuncs) Uniq(in interface{}) ([]interface{}, error)
- func (CollFuncs) Values(in ...map[string]interface{}) ([]interface{}, error)
- type ConvFuncs
- func ConvNS() *ConvFuncsdeprecated
- func (ConvFuncs) Atoi(s interface{}) int
- func (f *ConvFuncs) Bool(s interface{}) booldeprecated
- func (ConvFuncs) Default(def, in interface{}) interface{}
- func (f *ConvFuncs) Dict(in ...interface{}) (map[string]interface{}, error)deprecated
- func (f *ConvFuncs) Has(in interface{}, key string) booldeprecated
- func (ConvFuncs) Join(in interface{}, sep string) (string, error)
- func (ConvFuncs) ParseFloat(s interface{}, bitSize int) float64
- func (ConvFuncs) ParseInt(s interface{}, base, bitSize int) int64
- func (ConvFuncs) ParseUint(s interface{}, base, bitSize int) uint64
- func (f *ConvFuncs) Slice(args ...interface{}) []interface{}deprecated
- func (ConvFuncs) ToBool(in interface{}) bool
- func (ConvFuncs) ToBools(in ...interface{}) []bool
- func (ConvFuncs) ToFloat64(in interface{}) float64
- func (ConvFuncs) ToFloat64s(in ...interface{}) []float64
- func (ConvFuncs) ToInt(in interface{}) int
- func (ConvFuncs) ToInt64(in interface{}) int64
- func (ConvFuncs) ToInt64s(in ...interface{}) []int64
- func (ConvFuncs) ToInts(in ...interface{}) []int
- func (ConvFuncs) ToString(in interface{}) string
- func (ConvFuncs) ToStrings(in ...interface{}) []string
- func (ConvFuncs) URL(s interface{}) (*url.URL, error)
- type CryptoFuncs
- func CryptoNS() *CryptoFuncsdeprecated
- func (CryptoFuncs) Bcrypt(args ...interface{}) (string, error)
- func (f *CryptoFuncs) DecryptAES(key string, args ...interface{}) (string, error)
- func (f *CryptoFuncs) DecryptAESBytes(key string, args ...interface{}) ([]byte, error)
- func (f *CryptoFuncs) ECDSADerivePublicKey(privateKey string) (string, error)
- func (f *CryptoFuncs) ECDSAGenerateKey(args ...interface{}) (string, error)
- func (f *CryptoFuncs) Ed25519DerivePublicKey(privateKey string) (string, error)
- func (f *CryptoFuncs) Ed25519GenerateKey() (string, error)
- func (f *CryptoFuncs) Ed25519GenerateKeyFromSeed(encoding, seed string) (string, error)
- func (f *CryptoFuncs) EncryptAES(key string, args ...interface{}) ([]byte, error)
- func (CryptoFuncs) PBKDF2(password, salt, iter, keylen interface{}, hashFunc ...string) (k string, err error)
- func (f *CryptoFuncs) RSADecrypt(key string, in []byte) (string, error)
- func (f *CryptoFuncs) RSADecryptBytes(key string, in []byte) ([]byte, error)
- func (f *CryptoFuncs) RSADerivePublicKey(privateKey string) (string, error)
- func (f *CryptoFuncs) RSAEncrypt(key string, in interface{}) ([]byte, error)
- func (f *CryptoFuncs) RSAGenerateKey(args ...interface{}) (string, error)
- func (f CryptoFuncs) SHA1(input interface{}) string
- func (CryptoFuncs) SHA1Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) SHA224(input interface{}) string
- func (CryptoFuncs) SHA224Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) SHA256(input interface{}) string
- func (CryptoFuncs) SHA256Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) SHA384(input interface{}) string
- func (CryptoFuncs) SHA384Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) SHA512(input interface{}) string
- func (CryptoFuncs) SHA512Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) SHA512_224(input interface{}) string
- func (CryptoFuncs) SHA512_224Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) SHA512_256(input interface{}) string
- func (CryptoFuncs) SHA512_256Bytes(input interface{}) ([]byte, error)
- func (f CryptoFuncs) WPAPSK(ssid, password interface{}) (string, error)
- type DataFuncs
- func DataNS() *DataFuncsdeprecated
- func (f *DataFuncs) CSV(args ...string) ([][]string, error)
- func (f *DataFuncs) CSVByColumn(args ...string) (cols map[string][]string, err error)
- func (f *DataFuncs) CSVByRow(args ...string) (rows []map[string]string, err error)
- func (f *DataFuncs) CUE(in interface{}) (interface{}, error)
- func (f *DataFuncs) JSON(in interface{}) (map[string]interface{}, error)
- func (f *DataFuncs) JSONArray(in interface{}) ([]interface{}, error)
- func (f *DataFuncs) TOML(in interface{}) (interface{}, error)
- func (f *DataFuncs) ToCSV(args ...interface{}) (string, error)
- func (f *DataFuncs) ToCUE(in interface{}) (string, error)
- func (f *DataFuncs) ToJSON(in interface{}) (string, error)
- func (f *DataFuncs) ToJSONPretty(indent string, in interface{}) (string, error)
- func (f *DataFuncs) ToTOML(in interface{}) (string, error)
- func (f *DataFuncs) ToYAML(in interface{}) (string, error)
- func (f *DataFuncs) YAML(in interface{}) (map[string]interface{}, error)
- func (f *DataFuncs) YAMLArray(in interface{}) ([]interface{}, error)
- type EnvFuncs
- func EnvNS() *EnvFuncsdeprecated
- type FileFuncs
- func FileNS() *FileFuncsdeprecated
- func (f *FileFuncs) Exists(path interface{}) bool
- func (f *FileFuncs) IsDir(path interface{}) bool
- func (f *FileFuncs) Read(path interface{}) (string, error)
- func (f *FileFuncs) ReadDir(path interface{}) ([]string, error)
- func (f *FileFuncs) Stat(path interface{}) (fs.FileInfo, error)
- func (f *FileFuncs) Walk(path interface{}) ([]string, error)
- func (f *FileFuncs) Write(path interface{}, data interface{}) (s string, err error)
- type FilePathFuncs
- func FilePathNS() *FilePathFuncsdeprecated
- func (f *FilePathFuncs) Base(in interface{}) string
- func (f *FilePathFuncs) Clean(in interface{}) string
- func (f *FilePathFuncs) Dir(in interface{}) string
- func (f *FilePathFuncs) Ext(in interface{}) string
- func (f *FilePathFuncs) FromSlash(in interface{}) string
- func (f *FilePathFuncs) IsAbs(in interface{}) bool
- func (f *FilePathFuncs) Join(elem ...interface{}) string
- func (f *FilePathFuncs) Match(pattern, name interface{}) (matched bool, err error)
- func (f *FilePathFuncs) Rel(basepath, targpath interface{}) (string, error)
- func (f *FilePathFuncs) Split(in interface{}) []string
- func (f *FilePathFuncs) ToSlash(in interface{}) string
- func (f *FilePathFuncs) VolumeName(in interface{}) string
- type Funcs
- func AWSNS() *Funcsdeprecated
- func (a *Funcs) ARN() (string, error)
- func (a *Funcs) Account() (string, error)
- func (a *Funcs) EC2Dynamic(key string, def ...string) (string, error)
- func (a *Funcs) EC2Meta(key string, def ...string) (string, error)
- func (a *Funcs) EC2Region(def ...string) (string, error)
- func (a *Funcs) EC2Tag(tag string, def ...string) (string, error)
- func (a *Funcs) EC2Tags() (map[string]string, error)
- func (a *Funcs) KMSDecrypt(ciphertext interface{}) (string, error)
- func (a *Funcs) KMSEncrypt(keyID, plaintext interface{}) (string, error)
- func (a *Funcs) UserID() (string, error)
- type GcpFuncs
- func GCPNS() *GcpFuncsdeprecated
- type MathFuncs
- func MathNS() *MathFuncsdeprecated
- func (f MathFuncs) Abs(n interface{}) interface{}
- func (f MathFuncs) Add(n ...interface{}) interface{}
- func (f MathFuncs) Ceil(n interface{}) interface{}
- func (f MathFuncs) Div(a, b interface{}) (interface{}, error)
- func (f MathFuncs) Floor(n interface{}) interface{}
- func (f MathFuncs) IsFloat(n interface{}) bool
- func (f MathFuncs) IsInt(n interface{}) bool
- func (f MathFuncs) IsNum(n interface{}) bool
- func (f MathFuncs) Max(a interface{}, b ...interface{}) (interface{}, error)
- func (f MathFuncs) Min(a interface{}, b ...interface{}) (interface{}, error)
- func (f MathFuncs) Mul(n ...interface{}) interface{}
- func (f MathFuncs) Pow(a, b interface{}) interface{}
- func (f MathFuncs) Rem(a, b interface{}) interface{}
- func (f MathFuncs) Round(n interface{}) interface{}
- func (f MathFuncs) Seq(n ...interface{}) ([]int64, error)
- func (f MathFuncs) Sub(a, b interface{}) interface{}
- type NetFuncs
- func NetNS() *NetFuncsdeprecated
- func (f *NetFuncs) CIDRHost(hostnum interface{}, prefix interface{}) (netip.Addr, error)
- func (f *NetFuncs) CIDRNetmask(prefix interface{}) (netip.Addr, error)
- func (f *NetFuncs) CIDRSubnetSizes(args ...interface{}) ([]netip.Prefix, error)
- func (f *NetFuncs) CIDRSubnets(newbits interface{}, prefix interface{}) ([]netip.Prefix, error)
- func (f NetFuncs) LookupCNAME(name interface{}) (string, error)
- func (f NetFuncs) LookupIP(name interface{}) (string, error)
- func (f NetFuncs) LookupIPs(name interface{}) ([]string, error)
- func (f NetFuncs) LookupSRV(name interface{}) (*stdnet.SRV, error)
- func (f NetFuncs) LookupSRVs(name interface{}) ([]*stdnet.SRV, error)
- func (f NetFuncs) LookupTXT(name interface{}) ([]string, error)
- func (f NetFuncs) ParseAddr(ip interface{}) (netip.Addr, error)
- func (f *NetFuncs) ParseIP(ip interface{}) (netaddr.IP, error)deprecated
- func (f *NetFuncs) ParseIPPrefix(ipprefix interface{}) (netaddr.IPPrefix, error)deprecated
- func (f *NetFuncs) ParseIPRange(iprange interface{}) (netaddr.IPRange, error)deprecated
- func (f NetFuncs) ParsePrefix(ipprefix interface{}) (netip.Prefix, error)
- func (f NetFuncs) ParseRange(iprange interface{}) (netipx.IPRange, error)
- type PathFuncs
- func PathNS() *PathFuncsdeprecated
- func (PathFuncs) Base(in interface{}) string
- func (PathFuncs) Clean(in interface{}) string
- func (PathFuncs) Dir(in interface{}) string
- func (PathFuncs) Ext(in interface{}) string
- func (PathFuncs) IsAbs(in interface{}) bool
- func (PathFuncs) Join(elem ...interface{}) string
- func (PathFuncs) Match(pattern, name interface{}) (matched bool, err error)
- func (PathFuncs) Split(in interface{}) []string
- type RandomFuncs
- func RandomNS() *RandomFuncsdeprecated
- func (RandomFuncs) ASCII(count interface{}) (string, error)
- func (RandomFuncs) Alpha(count interface{}) (string, error)
- func (RandomFuncs) AlphaNum(count interface{}) (string, error)
- func (RandomFuncs) Float(args ...interface{}) (float64, error)
- func (RandomFuncs) Item(items interface{}) (interface{}, error)
- func (RandomFuncs) Number(args ...interface{}) (int64, error)
- func (RandomFuncs) String(count interface{}, args ...interface{}) (s string, err error)
- type ReFuncs
- func ReNS() *ReFuncsdeprecated
- func (ReFuncs) Find(re, input interface{}) (string, error)
- func (ReFuncs) FindAll(args ...interface{}) ([]string, error)
- func (ReFuncs) Match(re, input interface{}) bool
- func (ReFuncs) QuoteMeta(in interface{}) string
- func (ReFuncs) Replace(re, replacement, input interface{}) string
- func (ReFuncs) ReplaceLiteral(re, replacement, input interface{}) (string, error)
- func (ReFuncs) Split(args ...interface{}) ([]string, error)
- type SemverFuncs
- type SockaddrFuncs
- func SockaddrNS() *SockaddrFuncsdeprecated
- func (SockaddrFuncs) Attr(selectorName string, ifAddrsRaw interface{}) (string, error)
- func (SockaddrFuncs) Exclude(selectorName, selectorParam string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) GetAllInterfaces() (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) GetDefaultInterfaces() (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) GetInterfaceIP(namedIfRE string) (string, error)
- func (SockaddrFuncs) GetInterfaceIPs(namedIfRE string) (string, error)
- func (SockaddrFuncs) GetPrivateIP() (string, error)
- func (SockaddrFuncs) GetPrivateIPs() (string, error)
- func (SockaddrFuncs) GetPrivateInterfaces() (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) GetPublicIP() (string, error)
- func (SockaddrFuncs) GetPublicIPs() (string, error)
- func (SockaddrFuncs) GetPublicInterfaces() (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) Include(selectorName, selectorParam string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) Join(selectorName, joinString string, inputIfAddrs sockaddr.IfAddrs) (string, error)
- func (SockaddrFuncs) Limit(lim uint, in sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) Math(operation, value string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) Offset(off int, in sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) Sort(selectorParam string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- func (SockaddrFuncs) Unique(selectorName string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
- type StringFuncs
- func StrNS() *StringFuncsdeprecated
- func (StringFuncs) Abbrev(args ...interface{}) (string, error)
- func (StringFuncs) CamelCase(in interface{}) (string, error)
- func (StringFuncs) Contains(substr string, s interface{}) bool
- func (StringFuncs) HasPrefix(prefix string, s interface{}) bool
- func (StringFuncs) HasSuffix(suffix string, s interface{}) bool
- func (StringFuncs) Indent(args ...interface{}) (string, error)
- func (StringFuncs) KebabCase(in interface{}) (string, error)
- func (StringFuncs) Quote(in interface{}) string
- func (StringFuncs) Repeat(count int, s interface{}) (string, error)
- func (StringFuncs) ReplaceAll(old, new string, s interface{}) string
- func (StringFuncs) RuneCount(args ...interface{}) (int, error)
- func (StringFuncs) ShellQuote(in interface{}) string
- func (StringFuncs) SkipLines(skip int, in string) (string, error)
- func (StringFuncs) Slug(in interface{}) string
- func (StringFuncs) SnakeCase(in interface{}) (string, error)
- func (f *StringFuncs) Sort(list interface{}) ([]string, error)deprecated
- func (StringFuncs) Split(sep string, s interface{}) []string
- func (StringFuncs) SplitN(sep string, n int, s interface{}) []string
- func (StringFuncs) Squote(in interface{}) string
- func (f *StringFuncs) Title(s interface{}) string
- func (f *StringFuncs) ToLower(s interface{}) string
- func (f *StringFuncs) ToUpper(s interface{}) string
- func (StringFuncs) Trim(cutset string, s interface{}) string
- func (StringFuncs) TrimPrefix(cutset string, s interface{}) string
- func (StringFuncs) TrimSpace(s interface{}) string
- func (StringFuncs) TrimSuffix(cutset string, s interface{}) string
- func (StringFuncs) Trunc(length int, s interface{}) string
- func (StringFuncs) WordWrap(args ...interface{}) (string, error)
- type TestFuncs
- func TestNS() *TestFuncsdeprecated
- func (TestFuncs) Assert(args ...interface{}) (string, error)
- func (TestFuncs) Fail(args ...interface{}) (string, error)
- func (f TestFuncs) IsKind(kind string, arg interface{}) bool
- func (TestFuncs) Kind(arg interface{}) string
- func (TestFuncs) Required(args ...interface{}) (interface{}, error)
- func (TestFuncs) Ternary(tval, fval, b interface{}) interface{}
- type TimeFuncs
- func TimeNS() *TimeFuncsdeprecated
- func (TimeFuncs) Hour(n interface{}) gotime.Duration
- func (TimeFuncs) Microsecond(n interface{}) gotime.Duration
- func (TimeFuncs) Millisecond(n interface{}) gotime.Duration
- func (TimeFuncs) Minute(n interface{}) gotime.Duration
- func (TimeFuncs) Nanosecond(n interface{}) gotime.Duration
- func (TimeFuncs) Now() gotime.Time
- func (TimeFuncs) Parse(layout string, value interface{}) (gotime.Time, error)
- func (TimeFuncs) ParseDuration(n interface{}) (gotime.Duration, error)
- func (TimeFuncs) ParseInLocation(layout, location string, value interface{}) (gotime.Time, error)
- func (f TimeFuncs) ParseLocal(layout string, value interface{}) (gotime.Time, error)
- func (TimeFuncs) Second(n interface{}) gotime.Duration
- func (TimeFuncs) Since(n gotime.Time) gotime.Duration
- func (TimeFuncs) Unix(in interface{}) (gotime.Time, error)
- func (TimeFuncs) Until(n gotime.Time) gotime.Duration
- func (TimeFuncs) ZoneName() string
- func (TimeFuncs) ZoneOffset() int
- type UUIDFuncs
- func UUIDNS() *UUIDFuncsdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSFuncs
deprecated
func AddBase64Funcs
deprecated
func AddBase64Funcs(f map[string]interface{})
AddBase64Funcs -
Deprecated: use CreateBase64Funcs instead
func AddCollFuncs
deprecated
func AddConvFuncs
deprecated
func AddCryptoFuncs
deprecated
func AddCryptoFuncs(f map[string]interface{})
AddCryptoFuncs -
Deprecated: use CreateCryptoFuncs instead
func AddDataFuncs
deprecated
AddDataFuncs -
Deprecated: use CreateDataFuncs instead
func AddEnvFuncs
deprecated
func AddFileFuncs
deprecated
func AddFilePathFuncs
deprecated
func AddFilePathFuncs(f map[string]interface{})
AddFilePathFuncs -
Deprecated: use CreateFilePathFuncs instead
func AddGCPFuncs
deprecated
func AddMathFuncs
deprecated
func AddNetFuncs
deprecated
func AddPathFuncs
deprecated
func AddRandomFuncs
deprecated
func AddRandomFuncs(f map[string]interface{})
AddRandomFuncs -
Deprecated: use CreateRandomFuncs instead
func AddReFuncs
deprecated
func AddSockaddrFuncs
deprecated
func AddSockaddrFuncs(f map[string]interface{})
AddSockaddrFuncs -
Deprecated: use CreateSockaddrFuncs instead
func AddStringFuncs
deprecated
func AddStringFuncs(f map[string]interface{})
AddStringFuncs -
Deprecated: use CreateStringFuncs instead
func AddTestFuncs
deprecated
func AddTimeFuncs
deprecated
func AddUUIDFuncs
deprecated
func CreateAWSFuncs ¶
CreateAWSFuncs -
func CreateBase64Funcs ¶
CreateBase64Funcs -
func CreateCollFuncs ¶
CreateCollFuncs -
func CreateConvFuncs ¶
CreateConvFuncs -
func CreateCryptoFuncs ¶
CreateCryptoFuncs -
func CreateDataFuncs ¶
CreateDataFuncs -
func CreateEnvFuncs ¶
CreateEnvFuncs -
func CreateFileFuncs ¶
CreateFileFuncs -
func CreateFilePathFuncs ¶
CreateFilePathFuncs -
func CreateGCPFuncs ¶
CreateGCPFuncs -
func CreateMathFuncs ¶
CreateMathFuncs -
func CreateNetFuncs ¶
CreateNetFuncs -
func CreatePathFuncs ¶
CreatePathFuncs -
func CreateRandomFuncs ¶
CreateRandomFuncs -
func CreateSemverFuncs ¶
CreateSemverFuncs -
func CreateSockaddrFuncs ¶
CreateSockaddrFuncs -
func CreateStringFuncs ¶
CreateStringFuncs -
func CreateTestFuncs ¶
CreateTestFuncs -
func CreateTimeFuncs ¶
CreateTimeFuncs -
func CreateUUIDFuncs ¶
CreateUUIDFuncs -
Types ¶
type Base64Funcs ¶
type Base64Funcs struct {
// contains filtered or unexported fields
}
Base64Funcs -
func Base64NS
deprecated
func (Base64Funcs) DecodeBytes ¶
func (Base64Funcs) DecodeBytes(in interface{}) ([]byte, error)
DecodeBytes -
type CollFuncs ¶
type CollFuncs struct {
// contains filtered or unexported fields
}
CollFuncs -
func (CollFuncs) Index ¶
Index returns the result of indexing the last argument with the preceding index keys. This is similar to the `index` built-in template function, but the arguments are ordered differently for pipeline compatibility. Also, this function is more strict, and will return an error when the value doesn't contain the given key.
func (CollFuncs) Merge ¶
func (CollFuncs) Merge(dst map[string]interface{}, src ...map[string]interface{}) (map[string]interface{}, error)
Merge -
type ConvFuncs ¶
type ConvFuncs struct {
// contains filtered or unexported fields
}
ConvFuncs -
func (*ConvFuncs) Dict
deprecated
Dict -
Deprecated: use CollFuncs.Dict instead
func (*ConvFuncs) Has
deprecated
Has -
Deprecated: use CollFuncs.Has instead
func (ConvFuncs) ParseFloat ¶
ParseFloat -
func (*ConvFuncs) Slice
deprecated
func (f *ConvFuncs) Slice(args ...interface{}) []interface{}
Slice -
Deprecated: use CollFuncs.Slice instead
type CryptoFuncs ¶
type CryptoFuncs struct {
// contains filtered or unexported fields
}
CryptoFuncs -
func CryptoNS
deprecated
func (*CryptoFuncs) DecryptAES ¶
func (f *CryptoFuncs) DecryptAES(key string, args ...interface{}) (string, error)
DecryptAES - Experimental!
func (*CryptoFuncs) DecryptAESBytes ¶
func (f *CryptoFuncs) DecryptAESBytes(key string, args ...interface{}) ([]byte, error)
DecryptAESBytes - Experimental!
func (*CryptoFuncs) ECDSADerivePublicKey ¶
func (f *CryptoFuncs) ECDSADerivePublicKey(privateKey string) (string, error)
ECDSADerivePublicKey - Experimental!
func (*CryptoFuncs) ECDSAGenerateKey ¶
func (f *CryptoFuncs) ECDSAGenerateKey(args ...interface{}) (string, error)
ECDSAGenerateKey - Experimental!
func (*CryptoFuncs) Ed25519DerivePublicKey ¶
func (f *CryptoFuncs) Ed25519DerivePublicKey(privateKey string) (string, error)
Ed25519DerivePublicKey - Experimental!
func (*CryptoFuncs) Ed25519GenerateKey ¶
func (f *CryptoFuncs) Ed25519GenerateKey() (string, error)
Ed25519GenerateKey - Experimental!
func (*CryptoFuncs) Ed25519GenerateKeyFromSeed ¶
func (f *CryptoFuncs) Ed25519GenerateKeyFromSeed(encoding, seed string) (string, error)
Ed25519GenerateKeyFromSeed - Experimental!
func (*CryptoFuncs) EncryptAES ¶
func (f *CryptoFuncs) EncryptAES(key string, args ...interface{}) ([]byte, error)
EncryptAES - Experimental!
func (CryptoFuncs) PBKDF2 ¶
func (CryptoFuncs) PBKDF2(password, salt, iter, keylen interface{}, hashFunc ...string) (k string, err error)
PBKDF2 - Run the Password-Based Key Derivation Function #2 as defined in RFC 2898 (PKCS #5 v2.0). This function outputs the binary result in hex format.
func (*CryptoFuncs) RSADecrypt ¶
func (f *CryptoFuncs) RSADecrypt(key string, in []byte) (string, error)
RSADecrypt - Experimental!
func (*CryptoFuncs) RSADecryptBytes ¶
func (f *CryptoFuncs) RSADecryptBytes(key string, in []byte) ([]byte, error)
RSADecryptBytes - Experimental!
func (*CryptoFuncs) RSADerivePublicKey ¶
func (f *CryptoFuncs) RSADerivePublicKey(privateKey string) (string, error)
RSADerivePublicKey - Experimental!
func (*CryptoFuncs) RSAEncrypt ¶
func (f *CryptoFuncs) RSAEncrypt(key string, in interface{}) ([]byte, error)
RSAEncrypt - Experimental!
func (*CryptoFuncs) RSAGenerateKey ¶
func (f *CryptoFuncs) RSAGenerateKey(args ...interface{}) (string, error)
RSAGenerateKey - Experimental!
func (CryptoFuncs) SHA1 ¶
func (f CryptoFuncs) SHA1(input interface{}) string
SHA1 - Note: SHA-1 is cryptographically broken and should not be used for secure applications.
func (CryptoFuncs) SHA1Bytes ¶
func (CryptoFuncs) SHA1Bytes(input interface{}) ([]byte, error)
SHA1 - Note: SHA-1 is cryptographically broken and should not be used for secure applications.
func (CryptoFuncs) SHA224Bytes ¶
func (CryptoFuncs) SHA224Bytes(input interface{}) ([]byte, error)
SHA224 -
func (CryptoFuncs) SHA256Bytes ¶
func (CryptoFuncs) SHA256Bytes(input interface{}) ([]byte, error)
SHA256 -
func (CryptoFuncs) SHA384Bytes ¶
func (CryptoFuncs) SHA384Bytes(input interface{}) ([]byte, error)
SHA384 -
func (CryptoFuncs) SHA512Bytes ¶
func (CryptoFuncs) SHA512Bytes(input interface{}) ([]byte, error)
SHA512 -
func (CryptoFuncs) SHA512_224 ¶
func (f CryptoFuncs) SHA512_224(input interface{}) string
SHA512_224 -
func (CryptoFuncs) SHA512_224Bytes ¶
func (CryptoFuncs) SHA512_224Bytes(input interface{}) ([]byte, error)
SHA512_224 -
func (CryptoFuncs) SHA512_256 ¶
func (f CryptoFuncs) SHA512_256(input interface{}) string
SHA512_256 -
func (CryptoFuncs) SHA512_256Bytes ¶
func (CryptoFuncs) SHA512_256Bytes(input interface{}) ([]byte, error)
SHA512_256 -
func (CryptoFuncs) WPAPSK ¶
func (f CryptoFuncs) WPAPSK(ssid, password interface{}) (string, error)
WPAPSK - Convert an ASCII passphrase to WPA PSK for a given SSID
type DataFuncs ¶
type DataFuncs struct {
// contains filtered or unexported fields
}
DataFuncs -
func (*DataFuncs) CSVByColumn ¶
CSVByColumn -
func (*DataFuncs) ToJSONPretty ¶
ToJSONPretty -
type FileFuncs ¶
type FileFuncs struct {
// contains filtered or unexported fields
}
FileFuncs -
type FilePathFuncs ¶
type FilePathFuncs struct {
// contains filtered or unexported fields
}
FilePathFuncs -
func FilePathNS
deprecated
func (*FilePathFuncs) FromSlash ¶
func (f *FilePathFuncs) FromSlash(in interface{}) string
FromSlash -
func (*FilePathFuncs) Match ¶
func (f *FilePathFuncs) Match(pattern, name interface{}) (matched bool, err error)
Match -
func (*FilePathFuncs) Rel ¶
func (f *FilePathFuncs) Rel(basepath, targpath interface{}) (string, error)
Rel -
func (*FilePathFuncs) VolumeName ¶
func (f *FilePathFuncs) VolumeName(in interface{}) string
VolumeName -
type Funcs ¶
type Funcs struct {
// contains filtered or unexported fields
}
Funcs -
func (*Funcs) Account ¶
Account - Gets the AWS account ID number of the account that owns or contains the calling entity.
func (*Funcs) EC2Dynamic ¶
EC2Dynamic -
func (*Funcs) KMSDecrypt ¶
KMSDecrypt -
func (*Funcs) KMSEncrypt ¶
KMSEncrypt -
func (*Funcs) UserID ¶
UserID - Gets the unique identifier of the calling entity. The exact value depends on the type of entity making the call. The values returned are those listed in the aws:userid column in the Principal table (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) found on the Policy Variables reference page in the IAM User Guide.
type MathFuncs ¶
type MathFuncs struct {
// contains filtered or unexported fields
}
MathFuncs -
type NetFuncs ¶
type NetFuncs struct {
// contains filtered or unexported fields
}
NetFuncs -
func (*NetFuncs) CIDRNetmask ¶
CIDRNetmask - Experimental!
func (*NetFuncs) CIDRSubnetSizes ¶
CIDRSubnetSizes - Experimental!
func (*NetFuncs) CIDRSubnets ¶
CIDRSubnets - Experimental!
func (NetFuncs) LookupCNAME ¶
LookupCNAME -
func (NetFuncs) LookupSRVs ¶
LookupSRVs -
func (*NetFuncs) ParseIPPrefix
deprecated
func (*NetFuncs) ParseIPRange
deprecated
func (NetFuncs) ParsePrefix ¶
ParsePrefix -
type PathFuncs ¶
type PathFuncs struct {
// contains filtered or unexported fields
}
PathFuncs -
type RandomFuncs ¶
type RandomFuncs struct {
// contains filtered or unexported fields
}
RandomFuncs -
func RandomNS
deprecated
func (RandomFuncs) AlphaNum ¶
func (RandomFuncs) AlphaNum(count interface{}) (string, error)
AlphaNum -
func (RandomFuncs) String ¶
func (RandomFuncs) String(count interface{}, args ...interface{}) (s string, err error)
String -
type ReFuncs ¶
type ReFuncs struct {
// contains filtered or unexported fields
}
ReFuncs -
func (ReFuncs) ReplaceLiteral ¶
ReplaceLiteral -
type SemverFuncs ¶
type SemverFuncs struct {
// contains filtered or unexported fields
}
SemverFuncs -
func (SemverFuncs) CheckConstraint ¶
func (SemverFuncs) CheckConstraint(constraint, in string) (bool, error)
CheckConstraint -
func (SemverFuncs) Semver ¶
func (SemverFuncs) Semver(version string) (*semver.Version, error)
Semver -
type SockaddrFuncs ¶
type SockaddrFuncs struct {
// contains filtered or unexported fields
}
SockaddrFuncs -
func SockaddrNS
deprecated
func (SockaddrFuncs) Attr ¶
func (SockaddrFuncs) Attr(selectorName string, ifAddrsRaw interface{}) (string, error)
Attr -
func (SockaddrFuncs) Exclude ¶
func (SockaddrFuncs) Exclude(selectorName, selectorParam string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Exclude -
func (SockaddrFuncs) GetAllInterfaces ¶
func (SockaddrFuncs) GetAllInterfaces() (sockaddr.IfAddrs, error)
GetAllInterfaces -
func (SockaddrFuncs) GetDefaultInterfaces ¶
func (SockaddrFuncs) GetDefaultInterfaces() (sockaddr.IfAddrs, error)
GetDefaultInterfaces -
func (SockaddrFuncs) GetInterfaceIP ¶
func (SockaddrFuncs) GetInterfaceIP(namedIfRE string) (string, error)
GetInterfaceIP -
func (SockaddrFuncs) GetInterfaceIPs ¶
func (SockaddrFuncs) GetInterfaceIPs(namedIfRE string) (string, error)
GetInterfaceIPs -
func (SockaddrFuncs) GetPrivateIP ¶
func (SockaddrFuncs) GetPrivateIP() (string, error)
GetPrivateIP -
func (SockaddrFuncs) GetPrivateIPs ¶
func (SockaddrFuncs) GetPrivateIPs() (string, error)
GetPrivateIPs -
func (SockaddrFuncs) GetPrivateInterfaces ¶
func (SockaddrFuncs) GetPrivateInterfaces() (sockaddr.IfAddrs, error)
GetPrivateInterfaces -
func (SockaddrFuncs) GetPublicIPs ¶
func (SockaddrFuncs) GetPublicIPs() (string, error)
GetPublicIPs -
func (SockaddrFuncs) GetPublicInterfaces ¶
func (SockaddrFuncs) GetPublicInterfaces() (sockaddr.IfAddrs, error)
GetPublicInterfaces -
func (SockaddrFuncs) Include ¶
func (SockaddrFuncs) Include(selectorName, selectorParam string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Include -
func (SockaddrFuncs) Join ¶
func (SockaddrFuncs) Join(selectorName, joinString string, inputIfAddrs sockaddr.IfAddrs) (string, error)
Join -
func (SockaddrFuncs) Limit ¶
func (SockaddrFuncs) Limit(lim uint, in sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Limit -
func (SockaddrFuncs) Math ¶
func (SockaddrFuncs) Math(operation, value string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Math -
func (SockaddrFuncs) Offset ¶
func (SockaddrFuncs) Offset(off int, in sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Offset -
func (SockaddrFuncs) Sort ¶
func (SockaddrFuncs) Sort(selectorParam string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Sort -
func (SockaddrFuncs) Unique ¶
func (SockaddrFuncs) Unique(selectorName string, inputIfAddrs sockaddr.IfAddrs) (sockaddr.IfAddrs, error)
Unique -
type StringFuncs ¶
type StringFuncs struct {
// contains filtered or unexported fields
}
StringFuncs -
func StrNS
deprecated
func (StringFuncs) CamelCase ¶
func (StringFuncs) CamelCase(in interface{}) (string, error)
CamelCase -
func (StringFuncs) Contains ¶
func (StringFuncs) Contains(substr string, s interface{}) bool
Contains -
func (StringFuncs) HasPrefix ¶
func (StringFuncs) HasPrefix(prefix string, s interface{}) bool
HasPrefix -
func (StringFuncs) HasSuffix ¶
func (StringFuncs) HasSuffix(suffix string, s interface{}) bool
HasSuffix -
func (StringFuncs) KebabCase ¶
func (StringFuncs) KebabCase(in interface{}) (string, error)
KebabCase -
func (StringFuncs) Repeat ¶
func (StringFuncs) Repeat(count int, s interface{}) (string, error)
Repeat -
func (StringFuncs) ReplaceAll ¶
func (StringFuncs) ReplaceAll(old, new string, s interface{}) string
ReplaceAll -
func (StringFuncs) RuneCount ¶
func (StringFuncs) RuneCount(args ...interface{}) (int, error)
RuneCount - like len(s), but for runes
func (StringFuncs) SkipLines ¶
func (StringFuncs) SkipLines(skip int, in string) (string, error)
SkipLines -
func (StringFuncs) SnakeCase ¶
func (StringFuncs) SnakeCase(in interface{}) (string, error)
SnakeCase -
func (*StringFuncs) Sort
deprecated
func (f *StringFuncs) Sort(list interface{}) ([]string, error)
Sort -
Deprecated: use CollFuncs.Sort instead
func (StringFuncs) SplitN ¶
func (StringFuncs) SplitN(sep string, n int, s interface{}) []string
SplitN -
func (StringFuncs) TrimPrefix ¶
func (StringFuncs) TrimPrefix(cutset string, s interface{}) string
TrimPrefix -
func (StringFuncs) TrimSuffix ¶
func (StringFuncs) TrimSuffix(cutset string, s interface{}) string
TrimSuffix -
func (StringFuncs) WordWrap ¶
func (StringFuncs) WordWrap(args ...interface{}) (string, error)
WordWrap -
type TestFuncs ¶
type TestFuncs struct {
// contains filtered or unexported fields
}
TestFuncs -
type TimeFuncs ¶
type TimeFuncs struct { ANSIC string UnixDate string RubyDate string RFC822 string RFC822Z string RFC850 string RFC1123 string RFC1123Z string RFC3339 string RFC3339Nano string Kitchen string Stamp string StampMilli string StampMicro string StampNano string // contains filtered or unexported fields }
TimeFuncs -
func (TimeFuncs) Microsecond ¶
Microsecond -
func (TimeFuncs) Millisecond ¶
Millisecond -
func (TimeFuncs) Nanosecond ¶
Nanosecond -
func (TimeFuncs) ParseDuration ¶
ParseDuration -
func (TimeFuncs) ParseInLocation ¶
ParseInLocation -
func (TimeFuncs) ParseLocal ¶
ParseLocal -
func (TimeFuncs) Unix ¶
Unix - convert UNIX time (in seconds since the UNIX epoch) into a time.Time for further processing Takes a string or number (int or float)
func (TimeFuncs) ZoneOffset ¶
ZoneOffset - return the local system's time zone's name
type UUIDFuncs ¶
type UUIDFuncs struct {
// contains filtered or unexported fields
}
UUIDFuncs -
func (UUIDFuncs) IsValid ¶
IsValid - checks if the given UUID is in the correct format. It does not validate whether the version or variant are correct.
func (UUIDFuncs) Parse ¶
Parse - parse a UUID for further manipulation or inspection.
Both the standard UUID forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.