MCPcopy Index your code
hub / github.com/coder/coder / ConvertVariable

Method ConvertVariable

coderd/rbac/regosql/sqltypes/variable.go:90–101  ·  view source on GitHub ↗

ConvertVariable will return a new astStringVar Node if the given rego Ref matches this astStringVar.

(rego ast.Ref)

Source from the content-addressed store, hash-verified

88// ConvertVariable will return a new astStringVar Node if the given rego Ref
89// matches this astStringVar.
90func (s astStringVar) ConvertVariable(rego ast.Ref) (Node, bool) {
91 left, err := RegoVarPath(s.FieldPath, rego)
92 if err == nil && len(left) == 0 {
93 return astStringVar{
94 Source: RegoSource(rego.String()),
95 FieldPath: s.FieldPath,
96 ColumnString: s.ColumnString,
97 }, true
98 }
99
100 return nil, false
101}
102
103func (s astStringVar) SQLString(_ *SQLGenerator) string {
104 return s.ColumnString

Callers

nothing calls this directly

Calls 3

RegoVarPathFunction · 0.85
RegoSourceTypeAlias · 0.85
StringMethod · 0.45

Tested by

no test coverage detected