Skip to content

Commit

Permalink
Merge branch 'feature/fqdn-templates-with-string-functions'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Holtbrügge committed Jan 16, 2021
2 parents 11c1956 + c9cd832 commit 7c4e289
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,51 @@ const (
)

var fqdnTemplateFuncMap = template.FuncMap{
"compare": strings.Compare,
"contains": strings.Contains,
"containsAny": strings.ContainsAny,
"containsRune": strings.ContainsRune,
"count": strings.Count,
"equalFold": strings.EqualFold,
"fields": strings.Fields,
//"fieldsFunc": strings.FieldsFunc,
"hasPrefix": strings.HasPrefix,
"hasSuffix": strings.HasSuffix,
//"index": strings.Index,
"indexAny": strings.IndexAny,
"indexByte": strings.IndexByte,
//"indexFunc": strings.IndexFunc,
"indexRune": strings.IndexRune,
"join": strings.Join,
"lastIndex": strings.LastIndex,
"lastIndexAny": strings.LastIndexAny,
"lastIndexByte": strings.LastIndexByte,
//"lastIndexFunc": strings.LastIndexFunc,
//"map": strings.Map,
"repeat": strings.Repeat,
"replace": strings.Replace,
"replaceAll": strings.ReplaceAll,
"split": strings.Split,
"splitAfter": strings.SplitAfter,
"splitAfterN": strings.SplitAfterN,
"splitN": strings.SplitN,
//"title": strings.Title,
"toLower": strings.ToLower,
//"toLowerSpecial": strings.ToLowerSpecial,
"toTitle": strings.ToTitle,
//"toTitleSpecial": strings.ToTitleSpecial,
"toUpper": strings.ToUpper,
//"toUpperSpecial": strings.ToUpperSpecial,
"toValidUTF8": strings.ToValidUTF8,
"trim": strings.Trim,
//"trimFunc": strings.TrimFunc,
"trimLeft": strings.TrimLeft,
//"trimLeftFunc": strings.TrimLeftFunc,
"trimPrefix": strings.TrimPrefix,
"trimRight": strings.TrimRight,
//"trimRightFunc": strings.TrimRightFunc,
"trimSpace": strings.TrimSpace,
"trimSuffix": strings.TrimSuffix,
}

// Source defines the interface Endpoint sources should implement.
Expand Down

0 comments on commit 7c4e289

Please sign in to comment.