-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
- Loading branch information
Dave Henderson
committed
Aug 23, 2020
1 parent
4068327
commit 4be2c38
Showing
37 changed files
with
564 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,51 @@ | ||
| package gomplate | ||
|
|
||
| import ( | ||
| "context" | ||
| "text/template" | ||
|
|
||
| "github.com/hairyhenderson/gomplate/v3/data" | ||
| "github.com/hairyhenderson/gomplate/v3/funcs" | ||
| "github.com/hairyhenderson/gomplate/v3/internal/config" | ||
| ) | ||
|
|
||
| // Funcs - The function mappings are defined here! | ||
| // Funcs - | ||
| // Deprecated: use CreateFuncs instead | ||
| func Funcs(d *data.Data) template.FuncMap { | ||
| ctx := context.Background() | ||
| cfg := config.FromContext(ctx) | ||
| return CreateFuncs(config.ContextWithConfig(ctx, cfg), d) | ||
| } | ||
|
|
||
| // CreateFuncs - function mappings are created here | ||
| func CreateFuncs(ctx context.Context, d *data.Data) template.FuncMap { | ||
| f := template.FuncMap{} | ||
| funcs.AddDataFuncs(f, d) | ||
| funcs.AWSFuncs(f) | ||
| funcs.AddGCPFuncs(f) | ||
| funcs.AddBase64Funcs(f) | ||
| funcs.AddNetFuncs(f) | ||
| funcs.AddReFuncs(f) | ||
| funcs.AddStringFuncs(f) | ||
| funcs.AddEnvFuncs(f) | ||
| funcs.AddConvFuncs(f) | ||
| funcs.AddTimeFuncs(f) | ||
| funcs.AddMathFuncs(f) | ||
| funcs.AddCryptoFuncs(f) | ||
| funcs.AddFileFuncs(f) | ||
| funcs.AddFilePathFuncs(f) | ||
| funcs.AddPathFuncs(f) | ||
| funcs.AddSockaddrFuncs(f) | ||
| funcs.AddTestFuncs(f) | ||
| funcs.AddCollFuncs(f) | ||
| funcs.AddUUIDFuncs(f) | ||
| funcs.AddRandomFuncs(f) | ||
| addToMap(f, funcs.CreateDataFuncs(ctx, d)) | ||
| addToMap(f, funcs.CreateAWSFuncs(ctx)) | ||
| addToMap(f, funcs.CreateGCPFuncs(ctx)) | ||
| addToMap(f, funcs.CreateBase64Funcs(ctx)) | ||
| addToMap(f, funcs.CreateNetFuncs(ctx)) | ||
| addToMap(f, funcs.CreateReFuncs(ctx)) | ||
| addToMap(f, funcs.CreateStringFuncs(ctx)) | ||
| addToMap(f, funcs.CreateEnvFuncs(ctx)) | ||
| addToMap(f, funcs.CreateConvFuncs(ctx)) | ||
| addToMap(f, funcs.CreateTimeFuncs(ctx)) | ||
| addToMap(f, funcs.CreateMathFuncs(ctx)) | ||
| addToMap(f, funcs.CreateCryptoFuncs(ctx)) | ||
| addToMap(f, funcs.CreateFileFuncs(ctx)) | ||
| addToMap(f, funcs.CreateFilePathFuncs(ctx)) | ||
| addToMap(f, funcs.CreatePathFuncs(ctx)) | ||
| addToMap(f, funcs.CreateSockaddrFuncs(ctx)) | ||
| addToMap(f, funcs.CreateTestFuncs(ctx)) | ||
| addToMap(f, funcs.CreateCollFuncs(ctx)) | ||
| addToMap(f, funcs.CreateUUIDFuncs(ctx)) | ||
| addToMap(f, funcs.CreateRandomFuncs(ctx)) | ||
| return f | ||
| } | ||
|
|
||
| // addToMap - add src's entries to dst | ||
| func addToMap(dst, src map[string]interface{}) { | ||
| for k, v := range src { | ||
| dst[k] = v | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.