MCPcopy Index your code
hub / github.com/bytebase/bytebase / ValidateGroupCELExpr

Function ValidateGroupCELExpr

backend/common/cel.go:146–160  ·  view source on GitHub ↗

ValidateGroupCELExpr validates group expr.

(expr string)

Source from the content-addressed store, hash-verified

144
145// ValidateGroupCELExpr validates group expr.
146func ValidateGroupCELExpr(expr string) (cel.Program, error) {
147 e, err := cel.NewEnv(DatabaseGroupCELAttributes...)
148 if err != nil {
149 return nil, err
150 }
151 ast, issues := e.Compile(expr)
152 if issues != nil && issues.Err() != nil {
153 return nil, issues.Err()
154 }
155 prog, err := e.Program(ast)
156 if err != nil {
157 return nil, err
158 }
159 return prog, nil
160}
161
162// ValidateMaskingRuleCELExpr validates masking rule expr.
163func ValidateMaskingRuleCELExpr(expr string) (cel.Program, error) {

Callers 3

CheckDatabaseGroupMatchFunction · 0.92
CreateDatabaseGroupMethod · 0.92
UpdateDatabaseGroupMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected