Versions in this module Expand all Collapse all v3 v3.9.1 May 31, 2021 Changes in this version + func AWSFuncs(f map[string]interface{}) + func AddBase64Funcs(f map[string]interface{}) + func AddCollFuncs(f map[string]interface{}) + func AddConvFuncs(f map[string]interface{}) + func AddCryptoFuncs(f map[string]interface{}) + func AddDataFuncs(f map[string]interface{}, d *data.Data) + func AddEnvFuncs(f map[string]interface{}) + func AddFileFuncs(f map[string]interface{}) + func AddFilePathFuncs(f map[string]interface{}) + func AddGCPFuncs(f map[string]interface{}) + func AddMathFuncs(f map[string]interface{}) + func AddNetFuncs(f map[string]interface{}) + func AddPathFuncs(f map[string]interface{}) + func AddRandomFuncs(f map[string]interface{}) + func AddReFuncs(f map[string]interface{}) + func AddSockaddrFuncs(f map[string]interface{}) + func AddStringFuncs(f map[string]interface{}) + func AddTestFuncs(f map[string]interface{}) + func AddTimeFuncs(f map[string]interface{}) + func AddUUIDFuncs(f map[string]interface{}) + 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 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 struct + func Base64NS() *Base64Funcs + func (Base64Funcs) Decode(in interface{}) (string, error) + func (Base64Funcs) DecodeBytes(in interface{}) ([]byte, error) + func (Base64Funcs) Encode(in interface{}) (string, error) + type CollFuncs struct + func CollNS() *CollFuncs + 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) Has(in interface{}, key string) bool + 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 struct + func ConvNS() *ConvFuncs + func (ConvFuncs) Atoi(s interface{}) int + func (ConvFuncs) Bool(s interface{}) bool + func (ConvFuncs) Default(def, in interface{}) interface{} + func (ConvFuncs) Dict(in ...interface{}) (map[string]interface{}, error) + func (ConvFuncs) Has(in interface{}, key string) bool + 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 (ConvFuncs) Slice(args ...interface{}) []interface{} + 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 struct + func CryptoNS() *CryptoFuncs + func (CryptoFuncs) Bcrypt(args ...interface{}) (string, error) + func (CryptoFuncs) PBKDF2(password, salt, iter, keylen interface{}, hashFunc ...string) (k string, err error) + func (CryptoFuncs) SHA1(input interface{}) string + func (CryptoFuncs) SHA224(input interface{}) string + func (CryptoFuncs) SHA256(input interface{}) string + func (CryptoFuncs) SHA384(input interface{}) string + func (CryptoFuncs) SHA512(input interface{}) string + func (CryptoFuncs) SHA512_224(input interface{}) string + func (CryptoFuncs) SHA512_256(input interface{}) string + 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) WPAPSK(ssid, password interface{}) (string, error) + type DataFuncs struct + func DataNS() *DataFuncs + 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) 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) 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 struct + func EnvNS() *EnvFuncs + func (EnvFuncs) ExpandEnv(s interface{}) string + func (EnvFuncs) Getenv(key interface{}, def ...string) string + type FileFuncs struct + func FileNS() *FileFuncs + 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{}) (os.FileInfo, error) + func (f *FileFuncs) Walk(path interface{}) ([]string, error) + func (f *FileFuncs) Write(path interface{}, data interface{}) (s string, err error) + type FilePathFuncs struct + func FilePathNS() *FilePathFuncs + 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 struct + func AWSNS() *Funcs + 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 struct + func GCPNS() *GcpFuncs + func (a *GcpFuncs) Meta(key string, def ...string) (string, error) + type MathFuncs struct + func MathNS() *MathFuncs + 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 struct + func NetNS() *NetFuncs + 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) + type PathFuncs struct + func PathNS() *PathFuncs + 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 struct + func RandomNS() *RandomFuncs + 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 struct + func ReNS() *ReFuncs + 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 SockaddrFuncs struct + func SockaddrNS() *SockaddrFuncs + 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 struct + func StrNS() *StringFuncs + 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) Slug(in interface{}) string + func (StringFuncs) SnakeCase(in interface{}) (string, error) + func (StringFuncs) Sort(list interface{}) ([]string, error) + 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 (StringFuncs) Title(s interface{}) string + func (StringFuncs) ToLower(s interface{}) string + func (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 struct + func TestNS() *TestFuncs + func (TestFuncs) Assert(args ...interface{}) (string, error) + func (TestFuncs) Fail(args ...interface{}) (string, error) + func (TestFuncs) Kind(arg interface{}) string + func (TestFuncs) Required(args ...interface{}) (interface{}, error) + func (TestFuncs) Ternary(tval, fval, b interface{}) interface{} + func (f TestFuncs) IsKind(kind string, arg interface{}) bool + type TimeFuncs struct + ANSIC string + Kitchen string + RFC1123 string + RFC1123Z string + RFC3339 string + RFC3339Nano string + RFC822 string + RFC822Z string + RFC850 string + RubyDate string + Stamp string + StampMicro string + StampMilli string + StampNano string + UnixDate string + func TimeNS() *TimeFuncs + 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 (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 + func (f TimeFuncs) ParseLocal(layout string, value interface{}) (gotime.Time, error) + type UUIDFuncs struct + func UUIDNS() *UUIDFuncs + func (UUIDFuncs) Nil() (string, error) + func (UUIDFuncs) Parse(in interface{}) (uuid.UUID, error) + func (UUIDFuncs) V1() (string, error) + func (UUIDFuncs) V4() (string, error) + func (f UUIDFuncs) IsValid(in interface{}) (bool, error) Other modules containing this package github.com/duffpl/gomplate