MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Encoders

Function Encoders

ext/encoders.go:69–75  ·  view source on GitHub ↗

Encoders returns a cel.EnvOption to configure extended functions for string, byte, and object encodings. # Base64.Decode Decodes base64-encoded string to bytes. This function will return an error if the string input is not base64-encoded. base64.decode( ) -> Examples: base64.d

(options ...EncodersOption)

Source from the content-addressed store, hash-verified

67//
68// json.encode({'hello': 'world'}) // return '{"hello":"world"}'
69func Encoders(options ...EncodersOption) cel.EnvOption {
70 l := &encoderLib{version: math.MaxUint32}
71 for _, o := range options {
72 l = o(l)
73 }
74 return cel.Lib(l)
75}
76
77// EncodersOption declares a functional operator for configuring encoder extensions.
78type EncodersOption func(*encoderLib) *encoderLib

Callers 7

initFunction · 0.92
evaluator.goFile · 0.92
TestEncodersFunction · 0.85
TestEncodersVersionFunction · 0.85
testEncodersCostsEnvFunction · 0.85

Calls 1

LibFunction · 0.92

Tested by 5

initFunction · 0.74
TestEncodersFunction · 0.68
TestEncodersVersionFunction · 0.68
testEncodersCostsEnvFunction · 0.68