Versions in this module Expand all Collapse all v2 v2.0.0 Oct 14, 2022 Changes in this version + var BiscuitLexerRules = []lexer.Rule + var DefaultParserOptions = []participle.Option + var ErrVariableInFact = errors.New("parser: a fact cannot contain any variables") + var ErrVariableInSet = errors.New("parser: a set cannot contain any variables") + func FromStringCheck(input string) (biscuit.Check, error) + func FromStringFact(input string) (biscuit.Fact, error) + func FromStringPolicy(input string) (biscuit.Policy, error) + func FromStringRule(input string) (biscuit.Rule, error) + type Allow struct + Queries []*CheckQuery + type Bool bool + func (b *Bool) Capture(values []string) error + type Check struct + Queries []*CheckQuery + func (c *Check) ToBiscuit() (*biscuit.Check, error) + type CheckQuery struct + Body []*RuleElement + func (r *CheckQuery) ToBiscuit() (*biscuit.Rule, error) + type Comment string + func (c *Comment) Capture(values []string) error + type Deny struct + Queries []*CheckQuery + type Expr1 struct + Left *Expr2 + Right []*OpExpr2 + func (e *Expr1) ToExpr(expr *biscuit.Expression) + type Expr2 struct + Left *Expr3 + Right []*OpExpr3 + func (e *Expr2) ToExpr(expr *biscuit.Expression) + type Expr3 struct + Left *Expr4 + Right []*OpExpr4 + func (e *Expr3) ToExpr(expr *biscuit.Expression) + type Expr4 struct + Left *Expr5 + Right []*OpExpr5 + func (e *Expr4) ToExpr(expr *biscuit.Expression) + type Expr5 struct + Left *ExprTerm + Right []*OpExpr5 + func (e *Expr5) ToExpr(expr *biscuit.Expression) + type ExprTerm struct + Term *Term + Unary *Unary + func (e *ExprTerm) ToExpr(expr *biscuit.Expression) + type Expression struct + Left *Expr1 + Right []*OpExpr1 + func (e *Expression) ToExpr(expr *biscuit.Expression) + type HexString string + func (h *HexString) Decode() ([]byte, error) + func (h *HexString) Parse(lex *lexer.PeekingLexer) error + func (h *HexString) String() string + type Length struct + Term *Term + type MustParser interface + Check func(check string) biscuit.Check + Fact func(fact string) biscuit.Fact + Policy func(policy string) biscuit.Policy + Rule func(rule string) biscuit.Rule + type Negate struct + Expr5 *Expr5 + type OpExpr1 struct + Expr2 *Expr2 + Operator Operator + func (e *OpExpr1) ToExpr(expr *biscuit.Expression) + type OpExpr2 struct + Expr3 *Expr3 + Operator Operator + func (e *OpExpr2) ToExpr(expr *biscuit.Expression) + type OpExpr3 struct + Expr4 *Expr4 + Operator Operator + func (e *OpExpr3) ToExpr(expr *biscuit.Expression) + type OpExpr4 struct + Expr5 *Expr5 + Operator Operator + func (e *OpExpr4) ToExpr(expr *biscuit.Expression) + type OpExpr5 struct + Expression []*Expression + Operator Operator + func (e *OpExpr5) ToExpr(expr *biscuit.Expression) + type Operator int + const OpAdd + const OpAnd + const OpContains + const OpDiv + const OpEqual + const OpGreaterOrEqual + const OpGreaterThan + const OpIntersection + const OpLength + const OpLessOrEqual + const OpLessThan + const OpMatches + const OpMul + const OpOr + const OpPrefix + const OpSub + const OpSuffix + const OpUnion + func (o *Operator) Capture(s []string) error + func (op *Operator) ToExpr(expr *biscuit.Expression) + type Parens struct + Expression *Expression + type Parser interface + Check func(check string) (biscuit.Check, error) + Fact func(fact string) (biscuit.Fact, error) + Must func() MustParser + Policy func(policy string) (biscuit.Policy, error) + Rule func(rule string) (biscuit.Rule, error) + func New() Parser + type Policy struct + Allow *Allow + Deny *Deny + func (p *Policy) ToBiscuit() (*biscuit.Policy, error) + type Predicate struct + IDs []*Term + Name *string + func (p *Predicate) ToBiscuit() (*biscuit.Predicate, error) + type Rule struct + Body []*RuleElement + Comments []*Comment + Head *Predicate + func (r *Rule) ToBiscuit() (*biscuit.Rule, error) + type RuleElement struct + Expression *Expression + Predicate *Predicate + type Set struct + Bytes []HexString + Int []int64 + Not bool + String []string + type Term struct + Bool *Bool + Bytes *HexString + Date *string + Integer *int64 + Set []*Term + String *string + Variable *Variable + func (a *Term) ToBiscuit() (biscuit.Term, error) + type Unary struct + Negate *Negate + Parens *Parens + type Value struct + Number *float64 + Subexpression *Expression + Variable *string + type Variable string + func (v *Variable) Capture(values []string) error