Skip to content

Commit

Permalink
decodeBase64 func and script version update
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikmota committed Sep 16, 2024
1 parent d652ebc commit e23ac46
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions evaldo/builtins_pipes.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,25 @@ var Builtins_pipes = map[string]*env.Builtin{
},
},

"decodeBase64": {
Argsn: 1,
Doc: "decodeBase64 produces the string represented by the base64 encoded input.",
Fn: func(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env.Object, arg3 env.Object, arg4 env.Object) env.Object {
switch p := arg0.(type) {
case env.Native:
switch pipe := p.Value.(type) {
case *script.Pipe:
newPipe := pipe.DecodeBase64()
return *env.NewNative(ps.Idx, newPipe, "script-pipe")
default:
return MakeNativeArgError(ps, 1, []string{"script-pipe"}, "decodeBase64")
}
default:
return MakeArgError(ps, 1, []env.Type{env.NativeType}, "decodeBase64")
}
},
},

// GOPSUTIL

}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/aws/aws-sdk-go-v2 v1.30.5
github.com/aws/aws-sdk-go-v2/config v1.27.33
github.com/aws/aws-sdk-go-v2/service/ses v1.26.2
github.com/bitfield/script v0.22.1
github.com/bitfield/script v0.23.0
github.com/blevesearch/bleve/v2 v2.4.2
github.com/blevesearch/bleve_index_api v1.1.11
github.com/drewlanenga/govector v0.0.0-20220726163947-b958ac08bc93
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4=
github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
github.com/bitfield/script v0.22.1 h1:DphxoC5ssYciwd0ZS+N0Xae46geAD/0mVWh6a2NUxM4=
github.com/bitfield/script v0.22.1/go.mod h1:fv+6x4OzVsRs6qAlc7wiGq8fq1b5orhtQdtW0dwjUHI=
github.com/bitfield/script v0.23.0 h1:N0R5yLEl6wJIS9PR/A6xXwjMsplMubyxdi05N5l0X28=
github.com/bitfield/script v0.23.0/go.mod h1:fv+6x4OzVsRs6qAlc7wiGq8fq1b5orhtQdtW0dwjUHI=
github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA=
github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/blevesearch/bleve/v2 v2.4.2 h1:NooYP1mb3c0StkiY9/xviiq2LGSaE8BQBCc/pirMx0U=
Expand Down

0 comments on commit e23ac46

Please sign in to comment.