diff options
Diffstat (limited to 'funcs.go')
| -rw-r--r-- | funcs.go | 33 |
1 files changed, 5 insertions, 28 deletions
@@ -1,45 +1,22 @@ package main import ( - "net/url" "text/template" + "github.com/hairyhenderson/gomplate/data" "github.com/hairyhenderson/gomplate/funcs" ) // initFuncs - The function mappings are defined here! -func initFuncs(data *Data) template.FuncMap { - typeconv := &TypeConv{} - - f := template.FuncMap{ - "bool": typeconv.Bool, - "has": typeconv.Has, - "json": typeconv.JSON, - "jsonArray": typeconv.JSONArray, - "yaml": typeconv.YAML, - "yamlArray": typeconv.YAMLArray, - "toml": typeconv.TOML, - "csv": typeconv.CSV, - "csvByRow": typeconv.CSVByRow, - "csvByColumn": typeconv.CSVByColumn, - "slice": typeconv.Slice, - "join": typeconv.Join, - "toJSON": typeconv.ToJSON, - "toJSONPretty": typeconv.toJSONPretty, - "toYAML": typeconv.ToYAML, - "toTOML": typeconv.ToTOML, - "toCSV": typeconv.ToCSV, - "urlParse": url.Parse, - "datasource": data.Datasource, - "ds": data.Datasource, - "datasourceExists": data.DatasourceExists, - "include": data.include, - } +func initFuncs(d *data.Data) template.FuncMap { + f := template.FuncMap{} + funcs.AddDataFuncs(f, d) funcs.AWSFuncs(f) funcs.AddBase64Funcs(f) funcs.AddNetFuncs(f) funcs.AddReFuncs(f) funcs.AddStringFuncs(f) funcs.AddEnvFuncs(f) + funcs.AddConvFuncs(f) return f } |
