Versions in this module Expand all Collapse all v1 v1.2.0 Feb 28, 2025 Changes in this version + const LocalVarPrefix + var IndexResultPool = &indexResultPool + var InternalTestCase = &Builtin + var TermPtrPool = &termPtrPool + func TermValueEqual(a, b *Term) bool type Ref + func (ref Ref) CopyNonGround() Ref type Term + func InternedStringTerm(s string) *Term type TypeEnv + func (env *TypeEnv) GetByRef(ref Ref) types.Type + func (env *TypeEnv) GetByValue(v Value) types.Type type VarSet + func NewVarSetOfSize(size int) VarSet v1.1.0 Jan 27, 2025 Changes in this version + var InternedEmptyObject = ObjectTerm() + var InternedEmptyString = StringTerm("") + var InternedNullTerm = &Term + func RefCompare(a, b Ref) int + func RefEqual(a, b Ref) bool + func TermValueCompare(a, b *Term) int + func ValueEqual(a, b Value) bool + func ValueName(x Value) string + func VarCompare(a, b Var) int type Compiler + func (c *Compiler) WithPathConflictsCheckRoots(rootPaths []string) *Compiler type Value + var NullValue Value = Null{} v1.0.1 Jan 21, 2025 v1.0.0 Dec 20, 2024 Changes in this version + const CompileErr + const CompileErrorLimitDefault + const CompleteDoc + const DefaultRegoVersion + const FeatureRefHeadStringPrefixes + const FeatureRefHeads + const FeatureRegoV1 + const FeatureRegoV1Import + const MultiValue + const ParseErr + const PartialObjectDoc + const PartialSetDoc + const RecursionErr + const SingleValue + const SystemDocumentKey + const TypeErr + const UnsafeVarErr + const WildcardPrefix + var Abs = &Builtin + var AddDate = &Builtin + var All = &Builtin + var And = &Builtin + var Any = &Builtin + var AnyPrefixMatch = &Builtin + var AnySuffixMatch = &Builtin + var ArrayConcat = &Builtin + var ArrayReverse = &Builtin + var ArraySlice = &Builtin + var Assign = &Builtin + var Base64Decode = &Builtin + var Base64Encode = &Builtin + var Base64IsValid = &Builtin + var Base64UrlDecode = &Builtin + var Base64UrlEncode = &Builtin + var Base64UrlEncodeNoPad = &Builtin + var BitsAnd = &Builtin + var BitsNegate = &Builtin + var BitsOr = &Builtin + var BitsShiftLeft = &Builtin + var BitsShiftRight = &Builtin + var BitsXOr = &Builtin + var BuiltinMap map[string]*Builtin + var Builtins []*Builtin + var CastArray = &Builtin + var CastBoolean = &Builtin + var CastNull = &Builtin + var CastObject = &Builtin + var CastSet = &Builtin + var CastString = &Builtin + var Ceil = &Builtin + var Clock = &Builtin + var Concat = &Builtin + var Contains = &Builtin + var Count = &Builtin + var CryptoHmacEqual = &Builtin + var CryptoHmacMd5 = &Builtin + var CryptoHmacSha1 = &Builtin + var CryptoHmacSha256 = &Builtin + var CryptoHmacSha512 = &Builtin + var CryptoMd5 = &Builtin + var CryptoParsePrivateKeys = &Builtin + var CryptoSha1 = &Builtin + var CryptoSha256 = &Builtin + var CryptoX509ParseAndVerifyCertificates = &Builtin + var CryptoX509ParseAndVerifyCertificatesWithOptions = &Builtin + var CryptoX509ParseCertificateRequest = &Builtin + var CryptoX509ParseCertificates = &Builtin + var CryptoX509ParseKeyPair = &Builtin + var CryptoX509ParseRSAPrivateKey = &Builtin + var Date = &Builtin + var DefaultBuiltins = [...]*Builtin + var DefaultRootDocument = VarTerm("data") + var DefaultRootRef = Ref + var Diff = &Builtin + var Divide = &Builtin + var EndsWith = &Builtin + var Equal = &Builtin + var Equality = &Builtin + var Floor = &Builtin + var Format = &Builtin + var FormatInt = &Builtin + var FunctionArgRootDocument = VarTerm("args") + var FutureRootDocument = VarTerm("future") + var GlobMatch = &Builtin + var GlobQuoteMeta = &Builtin + var GlobsMatch = &Builtin + var GraphQLIsValid = &Builtin + var GraphQLParse = &Builtin + var GraphQLParseAndVerify = &Builtin + var GraphQLParseQuery = &Builtin + var GraphQLParseSchema = &Builtin + var GraphQLSchemaIsValid = &Builtin + var GreaterThan = &Builtin + var GreaterThanEq = &Builtin + var HTTPSend = &Builtin + var HexDecode = &Builtin + var HexEncode = &Builtin + var IgnoreDuringPartialEval = []*Builtin + var IndexOf = &Builtin + var IndexOfN = &Builtin + var InputRootDocument = VarTerm("input") + var InputRootRef = Ref + var InternalPrint = &Builtin + var Intersection = &Builtin + var IsArray = &Builtin + var IsBoolean = &Builtin + var IsNull = &Builtin + var IsNumber = &Builtin + var IsObject = &Builtin + var IsSet = &Builtin + var IsString = &Builtin + var JSONFilter = &Builtin + var JSONIsValid = &Builtin + var JSONMarshal = &Builtin + var JSONMarshalWithOptions = &Builtin + var JSONMatchSchema = &Builtin + var JSONPatch = &Builtin + var JSONRemove = &Builtin + var JSONSchemaVerify = &Builtin + var JSONUnmarshal = &Builtin + var JWTDecode = &Builtin + var JWTDecodeVerify = &Builtin + var JWTEncodeSign = &Builtin + var JWTEncodeSignRaw = &Builtin + var JWTVerifyES256 = &Builtin + var JWTVerifyES384 = &Builtin + var JWTVerifyES512 = &Builtin + var JWTVerifyHS256 = &Builtin + var JWTVerifyHS384 = &Builtin + var JWTVerifyHS512 = &Builtin + var JWTVerifyPS256 = &Builtin + var JWTVerifyPS384 = &Builtin + var JWTVerifyPS512 = &Builtin + var JWTVerifyRS256 = &Builtin + var JWTVerifyRS384 = &Builtin + var JWTVerifyRS512 = &Builtin + var Keywords = KeywordsForRegoVersion(DefaultRegoVersion) + var KeywordsV0 = [...]string + var KeywordsV1 = [...]string + var LessThan = &Builtin + var LessThanEq = &Builtin + var Lower = &Builtin + var Max = &Builtin + var Member = &Builtin + var MemberWithKey = &Builtin + var Min = &Builtin + var Minus = &Builtin + var Multiply = &Builtin + var NetCIDRContains = &Builtin + var NetCIDRContainsMatches = &Builtin + var NetCIDRExpand = &Builtin + var NetCIDRIntersects = &Builtin + var NetCIDRIsValid = &Builtin + var NetCIDRMerge = &Builtin + var NetCIDROverlap = &Builtin + var NetLookupIPAddr = &Builtin + var NotEqual = &Builtin + var NowNanos = &Builtin + var NumbersRange = &Builtin + var NumbersRangeStep = &Builtin + var OPARuntime = &Builtin + var ObjectFilter = &Builtin + var ObjectGet = &Builtin + var ObjectKeys = &Builtin + var ObjectRemove = &Builtin + var ObjectSubset = &Builtin + var ObjectUnion = &Builtin + var ObjectUnionN = &Builtin + var Or = &Builtin + var ParseDurationNanos = &Builtin + var ParseNanos = &Builtin + var ParseRFC3339Nanos = &Builtin + var Plus = &Builtin + var Print = &Builtin + var Product = &Builtin + var ProvidersAWSSignReqObj = &Builtin + var RandIntn = &Builtin + var ReachableBuiltin = &Builtin + var ReachablePathsBuiltin = &Builtin + var RegexFind = &Builtin + var RegexFindAllStringSubmatch = &Builtin + var RegexIsValid = &Builtin + var RegexMatch = &Builtin + var RegexMatchDeprecated = &Builtin + var RegexReplace = &Builtin + var RegexSplit = &Builtin + var RegexTemplateMatch = &Builtin + var RegoMetadataChain = &Builtin + var RegoMetadataRule = &Builtin + var RegoParseModule = &Builtin + var RegoRootDocument = VarTerm("rego") + var RegoV1CompatibleRef = Ref + var Rem = &Builtin + var RenderTemplate = &Builtin + var Replace = &Builtin + var ReplaceN = &Builtin + var ReservedVars = NewVarSet(DefaultRootDocument.Value.(Var), InputRootDocument.Value.(Var)) + var RootDocumentNames = NewSet(DefaultRootDocument, InputRootDocument) + var RootDocumentRefs = NewSet(NewTerm(DefaultRootRef), NewTerm(InputRootRef)) + var Round = &Builtin + var SafetyCheckVisitorParams = VarVisitorParams + var SchemaRootDocument = VarTerm("schema") + var SchemaRootRef = Ref + var SemVerCompare = &Builtin + var SemVerIsValid = &Builtin + var SetDiff = &Builtin + var Sort = &Builtin + var Split = &Builtin + var Sprintf = &Builtin + var StartsWith = &Builtin + var StringCount = &Builtin + var StringReverse = &Builtin + var Substring = &Builtin + var Sum = &Builtin + var ToNumber = &Builtin + var Trace = &Builtin + var Trim = &Builtin + var TrimLeft = &Builtin + var TrimPrefix = &Builtin + var TrimRight = &Builtin + var TrimSpace = &Builtin + var TrimSuffix = &Builtin + var TypeNameBuiltin = &Builtin + var URLQueryDecode = &Builtin + var URLQueryDecodeObject = &Builtin + var URLQueryEncode = &Builtin + var URLQueryEncodeObject = &Builtin + var UUIDParse = &Builtin + var UUIDRFC4122 = &Builtin + var Union = &Builtin + var UnitsParse = &Builtin + var UnitsParseBytes = &Builtin + var Upper = &Builtin + var WalkBuiltin = &Builtin + var Weekday = &Builtin + var Wildcard = &Term + var YAMLIsValid = &Builtin + var YAMLMarshal = &Builtin + var YAMLUnmarshal = &Builtin + func As(v Value, x interface{}) error + func BuildAnnotationSet(modules []*Module) (*AnnotationSet, Errors) + func Compare(a, b interface{}) int + func ContainsClosures(v interface{}) bool + func ContainsComprehensions(v interface{}) bool + func ContainsRefs(v interface{}) bool + func Copy(x interface{}) interface + func HasInternedIntNumberTerm(i int) bool + func IsComprehension(x Value) bool + func IsConstant(v Value) bool + func IsError(code string, err error) bool + func IsFutureKeyword(s string) bool + func IsFutureKeywordForRegoVersion(s string, v RegoVersion) bool + func IsInKeywords(s string, keywords []string) bool + func IsKeyword(s string) bool + func IsKeywordInRegoVersion(s string, regoVersion RegoVersion) bool + func IsScalar(v Value) bool + func IsUnknownValueErr(err error) bool + func IsValidImportPath(v Value) (err error) + func IsVarCompatibleString(s string) bool + func JSON(v Value) (interface{}, error) + func JSONWithOpt(v Value, opt JSONOpt) (interface{}, error) + func KeywordsForRegoVersion(v RegoVersion) []string + func LoadCapabilitiesVersions() ([]string, error) + func MustJSON(v Value) interface + func ParseStatements(filename, input string) ([]Statement, []*Comment, error) + func ParseStatementsWithOpts(filename, input string, popts ParserOptions) ([]Statement, []*Comment, error) + func Pretty(w io.Writer, x interface{}) + func RegisterBuiltin(b *Builtin) + func SetModuleRegoVersion(mod *Module, v RegoVersion) + func Transform(t Transformer, x interface{}) (interface{}, error) + func TransformComprehensions(x interface{}, f func(interface{}) (Value, error)) (interface{}, error) + func TransformRefs(x interface{}, f func(Ref) (Value, error)) (interface{}, error) + func TransformVars(x interface{}, f func(Var) (Value, error)) (interface{}, error) + func TypeName(x interface{}) string + func ValueToInterface(v Value, resolver Resolver) (interface{}, error) + func Walk(v Visitor, x interface{}) + func WalkBeforeAndAfter(v BeforeAndAfterVisitor, x interface{}) + func WalkBodies(x interface{}, f func(Body) bool) + func WalkClosures(x interface{}, f func(interface{}) bool) + func WalkExprs(x interface{}, f func(*Expr) bool) + func WalkNodes(x interface{}, f func(Node) bool) + func WalkRefs(x interface{}, f func(Ref) bool) + func WalkRules(x interface{}, f func(*Rule) bool) + func WalkTerms(x interface{}, f func(*Term) bool) + func WalkVars(x interface{}, f func(Var) bool) + func WalkWiths(x interface{}, f func(*With) bool) + type AnnotationSet struct + func (as *AnnotationSet) Chain(rule *Rule) AnnotationsRefSet + func (as *AnnotationSet) Flatten() FlatAnnotationsRefSet + func (as *AnnotationSet) GetDocumentScope(path Ref) *Annotations + func (as *AnnotationSet) GetPackageScope(pkg *Package) *Annotations + func (as *AnnotationSet) GetRuleScope(r *Rule) []*Annotations + func (as *AnnotationSet) GetSubpackagesScope(path Ref) []*Annotations + type Annotations struct + Authors []*AuthorAnnotation + Custom map[string]interface{} + Description string + Entrypoint bool + Location *Location + Organizations []string + RelatedResources []*RelatedResourceAnnotation + Schemas []*SchemaAnnotation + Scope string + Title string + func (a *Annotations) Compare(other *Annotations) int + func (a *Annotations) Copy(node Node) *Annotations + func (a *Annotations) EndLoc() *Location + func (a *Annotations) GetTargetPath() Ref + func (a *Annotations) Loc() *Location + func (a *Annotations) MarshalJSON() ([]byte, error) + func (a *Annotations) SetLoc(l *Location) + func (a *Annotations) String() string + type AnnotationsRef struct + Annotations *Annotations + Location *Location + Path Ref + func NewAnnotationsRef(a *Annotations) *AnnotationsRef + func (ar *AnnotationsRef) Compare(other *AnnotationsRef) int + func (ar *AnnotationsRef) GetPackage() *Package + func (ar *AnnotationsRef) GetRule() *Rule + func (ar *AnnotationsRef) MarshalJSON() ([]byte, error) + type AnnotationsRefSet []*AnnotationsRef + type ArgErrDetail struct + Have []types.Type + Want types.FuncArgs + func (d *ArgErrDetail) Lines() []string + type Args []*Term + func (a Args) Copy() Args + func (a Args) Loc() *Location + func (a Args) SetLoc(loc *Location) + func (a Args) String() string + func (a Args) Vars() VarSet + type Array struct + func NewArray(a ...*Term) *Array + func (arr *Array) Append(v *Term) *Array + func (arr *Array) Compare(other Value) int + func (arr *Array) Copy() *Array + func (arr *Array) Elem(i int) *Term + func (arr *Array) Equal(other Value) bool + func (arr *Array) Find(path Ref) (Value, error) + func (arr *Array) Foreach(f func(*Term)) + func (arr *Array) Get(pos *Term) *Term + func (arr *Array) Hash() int + func (arr *Array) IsGround() bool + func (arr *Array) Iter(f func(*Term) error) error + func (arr *Array) Len() int + func (arr *Array) MarshalJSON() ([]byte, error) + func (arr *Array) Set(i int, v *Term) + func (arr *Array) Slice(i, j int) *Array + func (arr *Array) Sorted() *Array + func (arr *Array) String() string + func (arr *Array) Until(f func(*Term) bool) bool + type ArrayComprehension struct + Body Body + Term *Term + func (ac *ArrayComprehension) Compare(other Value) int + func (ac *ArrayComprehension) Copy() *ArrayComprehension + func (ac *ArrayComprehension) Equal(other Value) bool + func (ac *ArrayComprehension) Find(path Ref) (Value, error) + func (ac *ArrayComprehension) Hash() int + func (ac *ArrayComprehension) IsGround() bool + func (ac *ArrayComprehension) String() string + type AuthorAnnotation struct + Email string + Name string + func (a *AuthorAnnotation) Compare(other *AuthorAnnotation) int + func (a *AuthorAnnotation) Copy() *AuthorAnnotation + func (a *AuthorAnnotation) String() string + type BeforeAfterVisitor struct + func NewBeforeAfterVisitor(before func(x interface{}) bool, after func(x interface{})) *BeforeAfterVisitor + func (vis *BeforeAfterVisitor) Walk(x interface{}) + type BeforeAndAfterVisitor interface + After func(x interface{}) + Before func(x interface{}) + type Body []*Expr + func MustParseBody(input string) Body + func MustParseBodyWithOpts(input string, opts ParserOptions) Body + func NewBody(exprs ...*Expr) Body + func ParseBody(input string) (Body, error) + func ParseBodyWithOpts(input string, popts ParserOptions) (Body, error) + func (body *Body) Append(expr *Expr) + func (body Body) Compare(other Body) int + func (body Body) Contains(x *Expr) bool + func (body Body) Copy() Body + func (body Body) Equal(other Body) bool + func (body Body) Hash() int + func (body Body) IsGround() bool + func (body Body) Loc() *Location + func (body Body) MarshalJSON() ([]byte, error) + func (body Body) Set(expr *Expr, pos int) + func (body Body) SetLoc(loc *Location) + func (body Body) String() string + func (body Body) Vars(params VarVisitorParams) VarSet + type Boolean bool + func (Boolean) IsGround() bool + func (bol Boolean) Compare(other Value) int + func (bol Boolean) Equal(other Value) bool + func (bol Boolean) Find(path Ref) (Value, error) + func (bol Boolean) Hash() int + func (bol Boolean) String() string + type Builtin struct + Categories []string + Decl *types.Function + Description string + Infix string + Name string + Nondeterministic bool + Relation bool + func (b *Builtin) Call(operands ...*Term) *Term + func (b *Builtin) Expr(operands ...*Term) *Expr + func (b *Builtin) IsDeprecated() bool + func (b *Builtin) IsNondeterministic() bool + func (b *Builtin) IsTargetPos(i int) bool + func (b *Builtin) Minimal() *Builtin + func (b *Builtin) Ref() Ref + type Call []*Term + func (c Call) Compare(other Value) int + func (c Call) Copy() Call + func (c Call) Find(Ref) (Value, error) + func (c Call) Hash() int + func (c Call) IsGround() bool + func (c Call) MakeExpr(output *Term) *Expr + func (c Call) String() string + type Capabilities struct + AllowNet []string + Builtins []*Builtin + Features []string + FutureKeywords []string + WasmABIVersions []WasmABIVersion + func CapabilitiesForThisVersion(opts ...CapabilitiesOption) *Capabilities + func LoadCapabilitiesFile(file string) (*Capabilities, error) + func LoadCapabilitiesJSON(r io.Reader) (*Capabilities, error) + func LoadCapabilitiesVersion(version string) (*Capabilities, error) + func (c *Capabilities) ContainsFeature(feature string) bool + func (c *Capabilities) MinimumCompatibleVersion() (string, bool) + type CapabilitiesOption func(*CapabilitiesOptions) + func CapabilitiesRegoVersion(regoVersion RegoVersion) CapabilitiesOption + type CapabilitiesOptions struct + type Comment struct + Location *Location + Text []byte + func NewComment(text []byte) *Comment + func (c *Comment) Copy() *Comment + func (c *Comment) Equal(other *Comment) bool + func (c *Comment) Loc() *Location + func (c *Comment) SetLoc(loc *Location) + func (c *Comment) String() string + type CompileOpts struct + EnablePrintStatements bool + ParserOptions ParserOptions + type Compiler struct + Errors Errors + Graph *Graph + ModuleTree *ModuleTreeNode + Modules map[string]*Module + Required *Capabilities + RewrittenVars map[Var]Var + RuleTree *TreeNode + TypeEnv *TypeEnv + func CompileModules(modules map[string]string) (*Compiler, error) + func CompileModulesWithOpt(modules map[string]string, opts CompileOpts) (*Compiler, error) + func MustCompileModules(modules map[string]string) *Compiler + func MustCompileModulesWithOpts(modules map[string]string, opts CompileOpts) *Compiler + func NewCompiler() *Compiler + func (c *Compiler) Capabilities() *Capabilities + func (c *Compiler) Compile(modules map[string]*Module) + func (c *Compiler) ComprehensionIndex(term *Term) *ComprehensionIndex + func (c *Compiler) DefaultRegoVersion() RegoVersion + func (c *Compiler) Failed() bool + func (c *Compiler) GetAnnotationSet() *AnnotationSet + func (c *Compiler) GetArity(ref Ref) int + func (c *Compiler) GetRules(ref Ref) (rules []*Rule) + func (c *Compiler) GetRulesDynamic(ref Ref) []*Rule + func (c *Compiler) GetRulesDynamicWithOpts(ref Ref, opts RulesOptions) []*Rule + func (c *Compiler) GetRulesExact(ref Ref) (rules []*Rule) + func (c *Compiler) GetRulesForVirtualDocument(ref Ref) (rules []*Rule) + func (c *Compiler) GetRulesWithPrefix(ref Ref) (rules []*Rule) + func (c *Compiler) ParsedModules() map[string]*Module + func (c *Compiler) PassesTypeCheck(body Body) bool + func (c *Compiler) PassesTypeCheckRules(rules []*Rule) Errors + func (c *Compiler) QueryCompiler() QueryCompiler + func (c *Compiler) RuleIndex(path Ref) RuleIndex + func (c *Compiler) SetErrorLimit(limit int) *Compiler + func (c *Compiler) WithAllowUndefinedFunctionCalls(allow bool) *Compiler + func (c *Compiler) WithBuiltins(builtins map[string]*Builtin) *Compiler + func (c *Compiler) WithCapabilities(capabilities *Capabilities) *Compiler + func (c *Compiler) WithDebug(sink io.Writer) *Compiler + func (c *Compiler) WithDefaultRegoVersion(regoVersion RegoVersion) *Compiler + func (c *Compiler) WithEnablePrintStatements(yes bool) *Compiler + func (c *Compiler) WithEvalMode(e CompilerEvalMode) *Compiler + func (c *Compiler) WithKeepModules(y bool) *Compiler + func (c *Compiler) WithMetrics(metrics metrics.Metrics) *Compiler + func (c *Compiler) WithModuleLoader(f ModuleLoader) *Compiler + func (c *Compiler) WithPathConflictsCheck(fn func([]string) (bool, error)) *Compiler + func (c *Compiler) WithRewriteTestRules(rewrite bool) *Compiler + func (c *Compiler) WithSchemas(schemas *SchemaSet) *Compiler + func (c *Compiler) WithStageAfter(after string, stage CompilerStageDefinition) *Compiler + func (c *Compiler) WithStrict(strict bool) *Compiler + func (c *Compiler) WithUnsafeBuiltins(unsafeBuiltins map[string]struct{}) *Compiler + func (c *Compiler) WithUseTypeCheckAnnotations(enabled bool) *Compiler + type CompilerEvalMode int + const EvalModeIR + const EvalModeTopdown + type CompilerStage func(*Compiler) *Error + type CompilerStageDefinition struct + MetricName string + Name string + Stage CompilerStage + type ComprehensionIndex struct + Keys []*Term + Term *Term + func (ci *ComprehensionIndex) String() string + type DocKind int + type Error struct + Code string + Details ErrorDetails + Location *Location + Message string + func NewError(code string, loc *Location, f string, a ...interface{}) *Error + func (e *Error) Error() string + type ErrorDetails interface + Lines func() []string + type Errors []*Error + func CheckPathConflicts(c *Compiler, exists func([]string) (bool, error)) Errors + func CheckRegoV1(x interface{}) Errors + func CheckRegoV1WithOptions(x interface{}, opts RegoCheckOptions) Errors + func (e Errors) Error() string + func (e Errors) Sort() + type Every struct + Body Body + Domain *Term + Key *Term + Location *Location + Value *Term + func (q *Every) Compare(other *Every) int + func (q *Every) Copy() *Every + func (q *Every) KeyValueVars() VarSet + func (q *Every) Loc() *Location + func (q *Every) MarshalJSON() ([]byte, error) + func (q *Every) SetLoc(l *Location) + func (q *Every) String() string + type Expr struct + Generated bool + Index int + Location *Location + Negated bool + Terms interface{} + With []*With + func MustParseExpr(input string) *Expr + func NewBuiltinExpr(terms ...*Term) *Expr + func NewExpr(terms interface{}) *Expr + func ParseExpr(input string) (*Expr, error) + func (expr *Expr) BaseCogeneratedExpr() *Expr + func (expr *Expr) CogeneratedExprs() []*Expr + func (expr *Expr) Compare(other *Expr) int + func (expr *Expr) Complement() *Expr + func (expr *Expr) ComplementNoWith() *Expr + func (expr *Expr) Copy() *Expr + func (expr *Expr) CopyWithoutTerms() *Expr + func (expr *Expr) Equal(other *Expr) bool + func (expr *Expr) Hash() int + func (expr *Expr) IncludeWith(target *Term, value *Term) *Expr + func (expr *Expr) IsAssignment() bool + func (expr *Expr) IsCall() bool + func (expr *Expr) IsEquality() bool + func (expr *Expr) IsEvery() bool + func (expr *Expr) IsGround() bool + func (expr *Expr) IsSome() bool + func (expr *Expr) Loc() *Location + func (expr *Expr) MarshalJSON() ([]byte, error) + func (expr *Expr) NoWith() *Expr + func (expr *Expr) Operand(pos int) *Term + func (expr *Expr) Operands() []*Term + func (expr *Expr) Operator() Ref + func (expr *Expr) OperatorTerm() *Term + func (expr *Expr) SetLoc(loc *Location) + func (expr *Expr) SetLocation(loc *Location) *Expr + func (expr *Expr) SetOperator(term *Term) *Expr + func (expr *Expr) String() string + func (expr *Expr) UnmarshalJSON(bs []byte) error + func (expr *Expr) Vars(params VarVisitorParams) VarSet + type FlatAnnotationsRefSet AnnotationsRefSet + func (ars FlatAnnotationsRefSet) Insert(ar *AnnotationsRef) FlatAnnotationsRefSet + type GenericTransformer struct + func NewGenericTransformer(f func(x interface{}) (interface{}, error)) *GenericTransformer + func (t *GenericTransformer) Transform(x interface{}) (interface{}, error) + type GenericVisitor struct + func NewGenericVisitor(f func(x interface{}) bool) *GenericVisitor + func (vis *GenericVisitor) Walk(x interface{}) + type Graph struct + func NewGraph(modules map[string]*Module, list func(Ref) []*Rule) *Graph + func (g *Graph) Dependencies(x util.T) map[util.T]struct{} + func (g *Graph) Dependents(x util.T) map[util.T]struct{} + func (g *Graph) Sort() (sorted []util.T, ok bool) + type GraphTraversal struct + func NewGraphTraversal(graph *Graph) *GraphTraversal + func (g *GraphTraversal) Edges(x util.T) []util.T + func (g *GraphTraversal) Visited(u util.T) bool + type Head struct + Args Args + Assign bool + Key *Term + Location *Location + Name Var + Reference Ref + Value *Term + func NewHead(name Var, args ...*Term) *Head + func RefHead(ref Ref, args ...*Term) *Head + func VarHead(name Var, location *Location, jsonOpts *astJSON.Options) *Head + func (head *Head) Compare(other *Head) int + func (head *Head) Copy() *Head + func (head *Head) DocKind() DocKind + func (head *Head) Equal(other *Head) bool + func (head *Head) HasDynamicRef() bool + func (head *Head) Loc() *Location + func (head *Head) MarshalJSON() ([]byte, error) + func (head *Head) Ref() Ref + func (head *Head) RuleKind() RuleKind + func (head *Head) SetLoc(loc *Location) + func (head *Head) SetRef(r Ref) + func (head *Head) String() string + func (head *Head) Vars() VarSet + type Import struct + Alias Var + Location *Location + Path *Term + func MustParseImports(input string) []*Import + func ParseImports(input string) ([]*Import, error) + func (imp *Import) Compare(other *Import) int + func (imp *Import) Copy() *Import + func (imp *Import) Equal(other *Import) bool + func (imp *Import) Loc() *Location + func (imp *Import) MarshalJSON() ([]byte, error) + func (imp *Import) Name() Var + func (imp *Import) SetLoc(loc *Location) + func (imp *Import) String() string + type IndexResult struct + Default *Rule + EarlyExit bool + Else map[*Rule][]*Rule + Kind RuleKind + OnlyGroundRefs bool + Rules []*Rule + func NewIndexResult(kind RuleKind) *IndexResult + func (ir *IndexResult) Empty() bool + type JSONOpt struct + CopyMaps bool + SortSets bool + type Location = location.Location + func NewLocation(text []byte, file string, row int, col int) *Location + type Module struct + Annotations []*Annotations + Comments []*Comment + Imports []*Import + Package *Package + Rules []*Rule + func MustParseModule(input string) *Module + func MustParseModuleWithOpts(input string, opts ParserOptions) *Module + func ParseModule(filename, input string) (*Module, error) + func ParseModuleWithOpts(filename, input string, popts ParserOptions) (*Module, error) + func (mod *Module) Compare(other *Module) int + func (mod *Module) Copy() *Module + func (mod *Module) Equal(other *Module) bool + func (mod *Module) RegoVersion() RegoVersion + func (mod *Module) RuleSet(name Var) RuleSet + func (mod *Module) SetRegoVersion(v RegoVersion) + func (mod *Module) String() string + func (mod *Module) UnmarshalJSON(bs []byte) error + type ModuleLoader func(resolved map[string]*Module) (parsed map[string]*Module, err error) + type ModuleTreeNode struct + Children map[Value]*ModuleTreeNode + Hide bool + Key Value + Modules []*Module + func NewModuleTree(mods map[string]*Module) *ModuleTreeNode + func (n *ModuleTreeNode) DepthFirst(f func(*ModuleTreeNode) bool) + func (n *ModuleTreeNode) Size() int + func (n *ModuleTreeNode) String() string + type Node interface + Loc func() *Location + SetLoc func(*Location) + type Null struct + func (Null) IsGround() bool + func (null Null) Compare(other Value) int + func (null Null) Equal(other Value) bool + func (null Null) Find(path Ref) (Value, error) + func (null Null) Hash() int + func (null Null) String() string + type Number json.Number + func (Number) IsGround() bool + func (num Number) Compare(other Value) int + func (num Number) Equal(other Value) bool + func (num Number) Find(path Ref) (Value, error) + func (num Number) Float64() (float64, bool) + func (num Number) Hash() int + func (num Number) Int() (int, bool) + func (num Number) Int64() (int64, bool) + func (num Number) MarshalJSON() ([]byte, error) + func (num Number) String() string + type Object interface + Copy func() Object + Diff func(other Object) Object + Filter func(filter Object) (Object, error) + Foreach func(func(*Term, *Term)) + Get func(*Term) *Term + Insert func(*Term, *Term) + Intersect func(other Object) [][3]*Term + Iter func(func(*Term, *Term) error) error + Keys func() []*Term + KeysIterator func() ObjectKeysIterator + Len func() int + Map func(func(*Term, *Term) (*Term, *Term, error)) (Object, error) + Merge func(other Object) (Object, bool) + MergeWith func(other Object, conflictResolver func(v1, v2 *Term) (*Term, bool)) (Object, bool) + Until func(func(*Term, *Term) bool) bool + func LazyObject(blob map[string]interface{}) Object + func NewObject(t ...[2]*Term) Object + type ObjectComprehension struct + Body Body + Key *Term + Value *Term + func (oc *ObjectComprehension) Compare(other Value) int + func (oc *ObjectComprehension) Copy() *ObjectComprehension + func (oc *ObjectComprehension) Equal(other Value) bool + func (oc *ObjectComprehension) Find(path Ref) (Value, error) + func (oc *ObjectComprehension) Hash() int + func (oc *ObjectComprehension) IsGround() bool + func (oc *ObjectComprehension) String() string + type ObjectKeysIterator interface + Next func() (*Term, bool) + type Package struct + Location *Location + Path Ref + func MustParsePackage(input string) *Package + func ParsePackage(input string) (*Package, error) + func (pkg *Package) Compare(other *Package) int + func (pkg *Package) Copy() *Package + func (pkg *Package) Equal(other *Package) bool + func (pkg *Package) Loc() *Location + func (pkg *Package) MarshalJSON() ([]byte, error) + func (pkg *Package) SetLoc(loc *Location) + func (pkg *Package) String() string + type Parser struct + func NewParser() *Parser + func (p *Parser) Parse() ([]Statement, []*Comment, Errors) + func (p *Parser) WithAllFutureKeywords(yes bool) *Parser + func (p *Parser) WithCapabilities(c *Capabilities) *Parser + func (p *Parser) WithFilename(filename string) *Parser + func (p *Parser) WithFutureKeywords(kws ...string) *Parser + func (p *Parser) WithJSONOptions(jsonOptions *astJSON.Options) *Parser + func (p *Parser) WithProcessAnnotation(processAnnotation bool) *Parser + func (p *Parser) WithReader(r io.Reader) *Parser + func (p *Parser) WithRegoVersion(version RegoVersion) *Parser + func (p *Parser) WithSkipRules(skip bool) *Parser + type ParserErrorDetail struct + Idx int + Line string + func (d ParserErrorDetail) Lines() []string + type ParserOptions struct + AllFutureKeywords bool + Capabilities *Capabilities + FutureKeywords []string + JSONOptions *astJSON.Options + ProcessAnnotation bool + RegoVersion RegoVersion + SkipRules bool + func (po *ParserOptions) EffectiveRegoVersion() RegoVersion + type QueryCompiler interface + Compile func(q Body) (Body, error) + ComprehensionIndex func(term *Term) *ComprehensionIndex + RewrittenVars func() map[Var]Var + TypeEnv func() *TypeEnv + WithContext func(qctx *QueryContext) QueryCompiler + WithEnablePrintStatements func(yes bool) QueryCompiler + WithStageAfter func(after string, stage QueryCompilerStageDefinition) QueryCompiler + WithStrict func(strict bool) QueryCompiler + WithUnsafeBuiltins func(unsafe map[string]struct{}) QueryCompiler + type QueryCompilerStage func(QueryCompiler, Body) (Body, error) + type QueryCompilerStageDefinition struct + MetricName string + Name string + Stage QueryCompilerStage + type QueryContext struct + Imports []*Import + Package *Package + func NewQueryContext() *QueryContext + func (qc *QueryContext) Copy() *QueryContext + func (qc *QueryContext) WithImports(imports []*Import) *QueryContext + func (qc *QueryContext) WithPackage(pkg *Package) *QueryContext + type QueryIterator func(map[Var]Value, Value) error + type Ref []*Term + func EmptyRef() Ref + func MustParseRef(input string) Ref + func ParseRef(input string) (Ref, error) + func PtrRef(head *Term, s string) (Ref, error) + func (ref Ref) Append(term *Term) Ref + func (ref Ref) Compare(other Value) int + func (ref Ref) Concat(terms []*Term) Ref + func (ref Ref) ConstantPrefix() Ref + func (ref Ref) Copy() Ref + func (ref Ref) Dynamic() int + func (ref Ref) DynamicSuffix() Ref + func (ref Ref) Equal(other Value) bool + func (ref Ref) Extend(other Ref) Ref + func (ref Ref) Find(path Ref) (Value, error) + func (ref Ref) GroundPrefix() Ref + func (ref Ref) HasPrefix(other Ref) bool + func (ref Ref) Hash() int + func (ref Ref) Insert(x *Term, pos int) Ref + func (ref Ref) IsGround() bool + func (ref Ref) IsNested() bool + func (ref Ref) OutputVars() VarSet + func (ref Ref) Ptr() (string, error) + func (ref Ref) String() string + func (ref Ref) StringPrefix() Ref + type RefErrInvalidDetail struct + Have types.Type + OneOf []Value + Pos int + Ref Ref + Want types.Type + func (r *RefErrInvalidDetail) Lines() []string + type RefErrUnsupportedDetail struct + Have types.Type + Pos int + Ref Ref + func (r *RefErrUnsupportedDetail) Lines() []string + type RegoCheckOptions struct + NoDeprecatedBuiltins bool + NoDuplicateImports bool + NoKeywordsAsRuleNames bool + NoRootDocumentOverrides bool + RequireContainsKeyword bool + RequireIfKeyword bool + RequireRuleBodyOrValue bool + func NewRegoCheckOptions() RegoCheckOptions + type RegoVersion int + const RegoUndefined + const RegoV0 + const RegoV0CompatV1 + const RegoV1 + func RegoVersionFromInt(i int) RegoVersion + func (v RegoVersion) Int() int + func (v RegoVersion) String() string + type RelatedResourceAnnotation struct + Description string + Ref url.URL + func (rr *RelatedResourceAnnotation) Compare(other *RelatedResourceAnnotation) int + func (rr *RelatedResourceAnnotation) Copy() *RelatedResourceAnnotation + func (rr *RelatedResourceAnnotation) MarshalJSON() ([]byte, error) + func (rr *RelatedResourceAnnotation) String() string + type Resolver interface + Resolve func(Ref) (interface{}, error) + type Rule struct + Annotations []*Annotations + Body Body + Default bool + Else *Rule + Head *Head + Location *Location + Module *Module + func MustParseRule(input string) *Rule + func MustParseRuleWithOpts(input string, opts ParserOptions) *Rule + func ParseCompleteDocRuleFromAssignmentExpr(module *Module, lhs, rhs *Term) (*Rule, error) + func ParseCompleteDocRuleFromEqExpr(module *Module, lhs, rhs *Term) (*Rule, error) + func ParseCompleteDocRuleWithDotsFromTerm(module *Module, term *Term) (*Rule, error) + func ParsePartialObjectDocRuleFromEqExpr(module *Module, lhs, rhs *Term) (*Rule, error) + func ParsePartialSetDocRuleFromTerm(module *Module, term *Term) (*Rule, error) + func ParseRule(input string) (*Rule, error) + func ParseRuleFromBody(module *Module, body Body) (*Rule, error) + func ParseRuleFromCallEqExpr(module *Module, lhs, rhs *Term) (*Rule, error) + func ParseRuleFromCallExpr(module *Module, terms []*Term) (*Rule, error) + func ParseRuleFromExpr(module *Module, expr *Expr) (*Rule, error) + func ParseRuleWithOpts(input string, opts ParserOptions) (*Rule, error) + func (rule *Rule) Compare(other *Rule) int + func (rule *Rule) Copy() *Rule + func (rule *Rule) Equal(other *Rule) bool + func (rule *Rule) Loc() *Location + func (rule *Rule) MarshalJSON() ([]byte, error) + func (rule *Rule) Path() Ref + func (rule *Rule) Ref() Ref + func (rule *Rule) SetLoc(loc *Location) + func (rule *Rule) String() string + type RuleIndex interface + AllRules func(resolver ValueResolver) (*IndexResult, error) + Build func(rules []*Rule) bool + Lookup func(resolver ValueResolver) (*IndexResult, error) + type RuleKind int + type RuleSet []*Rule + func NewRuleSet(rules ...*Rule) RuleSet + func (rs *RuleSet) Add(rule *Rule) + func (rs RuleSet) Contains(rule *Rule) bool + func (rs RuleSet) Diff(other RuleSet) RuleSet + func (rs RuleSet) Equal(other RuleSet) bool + func (rs RuleSet) Merge(other RuleSet) RuleSet + func (rs RuleSet) String() string + type RulesOptions struct + IncludeHiddenModules bool + type SchemaAnnotation struct + Definition *interface{} + Path Ref + Schema Ref + func (s *SchemaAnnotation) Compare(other *SchemaAnnotation) int + func (s *SchemaAnnotation) Copy() *SchemaAnnotation + func (s *SchemaAnnotation) String() string + type SchemaSet struct + func NewSchemaSet() *SchemaSet + func (ss *SchemaSet) Get(path Ref) interface{} + func (ss *SchemaSet) Put(path Ref, raw interface{}) + type Set interface + Add func(*Term) + Contains func(*Term) bool + Copy func() Set + Diff func(Set) Set + Foreach func(func(*Term)) + Intersect func(Set) Set + Iter func(func(*Term) error) error + Len func() int + Map func(func(*Term) (*Term, error)) (Set, error) + Reduce func(*Term, func(*Term, *Term) (*Term, error)) (*Term, error) + Slice func() []*Term + Sorted func() *Array + Union func(Set) Set + Until func(func(*Term) bool) bool + func NewSet(t ...*Term) Set + type SetComprehension struct + Body Body + Term *Term + func (sc *SetComprehension) Compare(other Value) int + func (sc *SetComprehension) Copy() *SetComprehension + func (sc *SetComprehension) Equal(other Value) bool + func (sc *SetComprehension) Find(path Ref) (Value, error) + func (sc *SetComprehension) Hash() int + func (sc *SetComprehension) IsGround() bool + func (sc *SetComprehension) String() string + type SomeDecl struct + Location *Location + Symbols []*Term + func (d *SomeDecl) Compare(other *SomeDecl) int + func (d *SomeDecl) Copy() *SomeDecl + func (d *SomeDecl) Hash() int + func (d *SomeDecl) Loc() *Location + func (d *SomeDecl) MarshalJSON() ([]byte, error) + func (d *SomeDecl) SetLoc(loc *Location) + func (d *SomeDecl) String() string + type Statement interface + func MustParseStatement(input string) Statement + func MustParseStatementWithOpts(input string, popts ParserOptions) Statement + func MustParseStatements(input string) []Statement + func ParseStatement(input string) (Statement, error) + func ParseStatementWithOpts(input string, popts ParserOptions) (Statement, error) + type String string + func (String) IsGround() bool + func (str String) Compare(other Value) int + func (str String) Equal(other Value) bool + func (str String) Find(path Ref) (Value, error) + func (str String) Hash() int + func (str String) String() string + type Term struct + Location *Location + Value Value + func ArrayComprehensionTerm(term *Term, body Body) *Term + func ArrayTerm(a ...*Term) *Term + func BooleanTerm(b bool) *Term + func CallTerm(terms ...*Term) *Term + func FloatNumberTerm(f float64) *Term + func IntNumberTerm(i int) *Term + func InternedBooleanTerm(b bool) *Term + func InternedIntNumberTerm(i int) *Term + func InternedIntNumberTermFromString(s string) *Term + func Item(key, value *Term) [2]*Term + func MustParseTerm(input string) *Term + func NewTerm(v Value) *Term + func NullTerm() *Term + func NumberTerm(n json.Number) *Term + func ObjectComprehensionTerm(key, value *Term, body Body) *Term + func ObjectTerm(o ...[2]*Term) *Term + func ParseTerm(input string) (*Term, error) + func RefTerm(r ...*Term) *Term + func SetComprehensionTerm(term *Term, body Body) *Term + func SetTerm(t ...*Term) *Term + func StringTerm(s string) *Term + func UIntNumberTerm(u uint64) *Term + func VarTerm(v string) *Term + func (term *Term) Copy() *Term + func (term *Term) Equal(other *Term) bool + func (term *Term) Get(name *Term) *Term + func (term *Term) Hash() int + func (term *Term) IsGround() bool + func (term *Term) Loc() *Location + func (term *Term) MarshalJSON() ([]byte, error) + func (term *Term) SetLoc(loc *Location) + func (term *Term) SetLocation(loc *Location) *Term + func (term *Term) String() string + func (term *Term) UnmarshalJSON(bs []byte) error + func (term *Term) Vars() VarSet + type Transformer interface + Transform func(interface{}) (interface{}, error) + type TreeNode struct + Children map[Value]*TreeNode + Hide bool + Key Value + Sorted []Value + Values []util.T + func NewRuleTree(mtree *ModuleTreeNode) *TreeNode + func (n *TreeNode) Child(k Value) *TreeNode + func (n *TreeNode) DepthFirst(f func(*TreeNode) bool) + func (n *TreeNode) Find(ref Ref) *TreeNode + func (n *TreeNode) Size() int + func (n *TreeNode) String() string + type TypeEnv struct + func (env *TypeEnv) Get(x interface{}) types.Type + type UnificationErrDetail struct + Left types.Type + Right types.Type + func (a *UnificationErrDetail) Lines() []string + type UnknownValueErr struct + func (UnknownValueErr) Error() string + type Value interface + Compare func(other Value) int + Find func(path Ref) (Value, error) + Hash func() int + IsGround func() bool + String func() string + func InterfaceToValue(x interface{}) (Value, error) + func MustInterfaceToValue(x interface{}) Value + func ValueFromReader(r io.Reader) (Value, error) + type ValueMap struct + func NewValueMap() *ValueMap + func (vs *ValueMap) Copy() *ValueMap + func (vs *ValueMap) Delete(k Value) + func (vs *ValueMap) Equal(other *ValueMap) bool + func (vs *ValueMap) Get(k Value) Value + func (vs *ValueMap) Hash() int + func (vs *ValueMap) Iter(iter func(Value, Value) bool) bool + func (vs *ValueMap) Len() int + func (vs *ValueMap) MarshalJSON() ([]byte, error) + func (vs *ValueMap) Put(k, v Value) + func (vs *ValueMap) String() string + type ValueResolver interface + Resolve func(Ref) (Value, error) + type Var string + func (Var) IsGround() bool + func (v Var) Compare(other Value) int + func (v Var) Equal(other Value) bool + func (v Var) Find(path Ref) (Value, error) + func (v Var) Hash() int + func (v Var) IsGenerated() bool + func (v Var) IsWildcard() bool + func (v Var) String() string + type VarSet map[Var]struct + func NewVarSet(vs ...Var) VarSet + func OutputVarsFromBody(c *Compiler, body Body, safe VarSet) VarSet + func OutputVarsFromExpr(c *Compiler, expr *Expr, safe VarSet) VarSet + func Unify(safe VarSet, a *Term, b *Term) VarSet + func (s VarSet) Add(v Var) + func (s VarSet) Contains(v Var) bool + func (s VarSet) Copy() VarSet + func (s VarSet) Diff(vs VarSet) VarSet + func (s VarSet) Equal(vs VarSet) bool + func (s VarSet) Intersect(vs VarSet) VarSet + func (s VarSet) Sorted() []Var + func (s VarSet) String() string + func (s VarSet) Update(vs VarSet) + type VarVisitor struct + func NewVarVisitor() *VarVisitor + func (vis *VarVisitor) Vars() VarSet + func (vis *VarVisitor) Walk(x interface{}) + func (vis *VarVisitor) WithParams(params VarVisitorParams) *VarVisitor + type VarVisitorParams struct + SkipClosures bool + SkipObjectKeys bool + SkipRefCallHead bool + SkipRefHead bool + SkipSets bool + SkipWithTarget bool + type VersionIndex struct + Builtins map[string]semver.Version + Features map[string]semver.Version + Keywords map[string]semver.Version + type Visitor interface + Visit func(v interface{}) (w Visitor) + type WasmABIVersion struct + Minor int + Version int + type With struct + Location *Location + Target *Term + Value *Term + func (w *With) Compare(other *With) int + func (w *With) Copy() *With + func (w *With) Equal(other *With) bool + func (w *With) Loc() *Location + func (w *With) MarshalJSON() ([]byte, error) + func (w *With) SetLoc(loc *Location) + func (w *With) SetLocation(loc *Location) *With + func (w *With) String() string + func (w With) Hash() int