NewParser creates a new Parser object with a set of functional options.
(opts ...ParserOption)
| 512 | |
| 513 | // NewParser creates a new Parser object with a set of functional options. |
| 514 | func NewParser(opts ...ParserOption) (*Parser, error) { |
| 515 | p := &Parser{TagVisitor: defaultTagVisitor{}} |
| 516 | var err error |
| 517 | for _, o := range opts { |
| 518 | p, err = o(p) |
| 519 | if err != nil { |
| 520 | return nil, err |
| 521 | } |
| 522 | } |
| 523 | return p, nil |
| 524 | } |
| 525 | |
| 526 | // Parse generates an internal parsed policy representation from a YAML input file. |
| 527 | // The internal representation ensures that CEL expressions are tracked relative to |
no outgoing calls