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

Function NewTextSource

common/source.go:73–75  ·  view source on GitHub ↗

TODO(jimlarson) "Character offsets" should index the code points within the UTF-8 encoded string. It currently indexes bytes. Can be accomplished by using rune[] instead of string for contents. NewTextSource creates a new Source from the input text string.

(text string)

Source from the content-addressed store, hash-verified

71
72// NewTextSource creates a new Source from the input text string.
73func NewTextSource(text string) Source {
74 return NewStringSource(text, "<input>")
75}
76
77// NewTextSourceWithLimit creates a new Source from the input text string while
78// enforcing a maximum code point count when needed.

Callers 15

computeCostFunction · 0.92
programFunction · 0.92
testMustParseFunction · 0.92
TestCheckFunction · 0.92
BenchmarkCheckFunction · 0.92
TestCheckErrorDataFunction · 0.92

Calls 1

NewStringSourceFunction · 0.85

Tested by 15

computeCostFunction · 0.74
programFunction · 0.74
testMustParseFunction · 0.74
TestCheckFunction · 0.74
BenchmarkCheckFunction · 0.74
TestCheckErrorDataFunction · 0.74