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

Method Relative

policy/source.go:40–46  ·  view source on GitHub ↗

Relative produces a RelativeSource object for the content provided at the absolute location within the parent Source as indicated by the line and column.

(content string, line, col int)

Source from the content-addressed store, hash-verified

38// Relative produces a RelativeSource object for the content provided at the absolute location
39// within the parent Source as indicated by the line and column.
40func (src *Source) Relative(content string, line, col int) *RelativeSource {
41 return &RelativeSource{
42 Source: src.Source,
43 localSrc: common.NewStringSource(content, src.Description()),
44 absLoc: common.NewLocation(line, col),
45 }
46}
47
48// RelativeSource represents an embedded source element within a larger source.
49type RelativeSource struct {

Callers 1

relSourceMethod · 0.80

Calls 3

DescriptionMethod · 0.95
NewStringSourceFunction · 0.92
NewLocationFunction · 0.92

Tested by

no test coverage detected