Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename base64enc/dec to encode/decode #3402

Merged
merged 1 commit into from
Oct 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions config/interpolate_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ var Funcs map[string]ast.Function

func init() {
Funcs = map[string]ast.Function{
"concat": interpolationFuncConcat(),
"element": interpolationFuncElement(),
"file": interpolationFuncFile(),
"format": interpolationFuncFormat(),
"formatlist": interpolationFuncFormatList(),
"index": interpolationFuncIndex(),
"join": interpolationFuncJoin(),
"length": interpolationFuncLength(),
"replace": interpolationFuncReplace(),
"split": interpolationFuncSplit(),
"base64enc": interpolationFuncBase64Encode(),
"base64dec": interpolationFuncBase64Decode(),
"concat": interpolationFuncConcat(),
"element": interpolationFuncElement(),
"file": interpolationFuncFile(),
"format": interpolationFuncFormat(),
"formatlist": interpolationFuncFormatList(),
"index": interpolationFuncIndex(),
"join": interpolationFuncJoin(),
"length": interpolationFuncLength(),
"replace": interpolationFuncReplace(),
"split": interpolationFuncSplit(),
"base64encode": interpolationFuncBase64Encode(),
"base64decode": interpolationFuncBase64Decode(),
}
}

Expand Down Expand Up @@ -396,8 +396,8 @@ func interpolationFuncValues(vs map[string]ast.Variable) ast.Function {
}
}

// interpolationFuncBase64Encode implements the "base64enc" function that allows
// Base64 encoding.
// interpolationFuncBase64Encode implements the "base64encode" function that
// allows Base64 encoding.
func interpolationFuncBase64Encode() ast.Function {
return ast.Function{
ArgTypes: []ast.Type{ast.TypeString},
Expand All @@ -409,8 +409,8 @@ func interpolationFuncBase64Encode() ast.Function {
}
}

// interpolationFuncBase64Decode implements the "base64dec" function that allows
// Base64 decoding.
// interpolationFuncBase64Decode implements the "base64decode" function that
// allows Base64 decoding.
func interpolationFuncBase64Decode() ast.Function {
return ast.Function{
ArgTypes: []ast.Type{ast.TypeString},
Expand Down
6 changes: 3 additions & 3 deletions config/interpolate_funcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func TestInterpolateFuncBase64Encode(t *testing.T) {
Cases: []testFunctionCase{
// Regular base64 encoding
{
`${base64enc("abc123!?$*&()'-=@~")}`,
`${base64encode("abc123!?$*&()'-=@~")}`,
"YWJjMTIzIT8kKiYoKSctPUB+",
false,
},
Expand All @@ -602,14 +602,14 @@ func TestInterpolateFuncBase64Decode(t *testing.T) {
Cases: []testFunctionCase{
// Regular base64 decoding
{
`${base64dec("YWJjMTIzIT8kKiYoKSctPUB+")}`,
`${base64decode("YWJjMTIzIT8kKiYoKSctPUB+")}`,
"abc123!?$*&()'-=@~",
false,
},

// Invalid base64 data decoding
{
`${base64dec("this-is-an-invalid-base64-data")}`,
`${base64decode("this-is-an-invalid-base64-data")}`,
nil,
true,
},
Expand Down
4 changes: 2 additions & 2 deletions website/source/docs/configuration/interpolation.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ are documented below.

The supported built-in functions are:

* `base64dec(string)` - Given a base64-encoded string, decodes it and
* `base64decode(string)` - Given a base64-encoded string, decodes it and
returns the original string.

* `base64enc(string)` - Returns a base64-encoded representation of the
* `base64encode(string)` - Returns a base64-encoded representation of the
given string.

* `concat(list1, list2)` - Combines two or more lists into a single list.
Expand Down