()
| 127 | } |
| 128 | |
| 129 | func (lib *encoderLib) ProgramOptions() []cel.ProgramOption { |
| 130 | var opts []cel.ProgramOption |
| 131 | if lib.version >= 1 { |
| 132 | trackers := []interpreter.CostTrackerOption{ |
| 133 | interpreter.OverloadCostTracker("base64_decode_string", trackDecode), |
| 134 | interpreter.OverloadCostTracker("base64_encode_bytes", trackEncode), |
| 135 | interpreter.OverloadCostTracker("json_encode_dyn", trackJSONEncode), |
| 136 | } |
| 137 | opts = append(opts, cel.CostTrackerOptions(trackers...)) |
| 138 | } |
| 139 | return opts |
| 140 | } |
| 141 | |
| 142 | func base64DecodeString(str string) ([]byte, error) { |
| 143 | b, err := base64.StdEncoding.DecodeString(str) |
nothing calls this directly
no test coverage detected