Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/open-policy-agent/opa
/ functions
Functions
11,070 in github.com/open-policy-agent/opa
⨍
Functions
11,070
◇
Types & classes
1,577
↓ 99 callers
Method
appendStmt
(s ir.Stmt)
internal/planner/planner.go:2363
↓ 96 callers
Method
Elem
Elem returns the element i of arr.
v1/ast/term.go:1718
↓ 93 callers
Method
PrepareForEval
(context.Context, *ir.Policy, ...PrepareOption)
v1/rego/plugins.go:20
↓ 91 callers
Method
Init
Init returns an initialized [ExternalRuleIndex]. A `Ref` is provided so we know which package we're preparing if multiple Refs are external.
v1/ast/external_source.go:20
↓ 90 callers
Method
Int
Int returns the int representation of num if possible.
v1/ast/term.go:888
↓ 89 callers
Method
SetLocation
(index, row, col int, file, text string)
v1/ir/ir.go:87
↓ 89 callers
Function
assertParseRule
(t *testing.T, msg string, input string, correct *Rule, opts ...ParserOptions)
v1/ast/parser_test.go:8482
↓ 88 callers
Function
InterfaceToValue
InterfaceToValue converts a native Go value x to a Value.
v1/ast/term.go:72
↓ 88 callers
Method
WithStore
WithStore sets the store to use for the query.
v1/topdown/query.go:100
↓ 87 callers
Method
Header
()
v1/runtime/logging.go:237
↓ 87 callers
Function
ParseModuleWithOpts
ParseModuleWithOpts returns a parsed Module object, and has an additional input ParserOptions For details on Module objects and their fields, see poli
v1/ast/parser_ext.go:482
↓ 86 callers
Function
NewArray
NewArray creates an Array with the terms provided. The array will use the provided term slice.
v1/ast/term.go:1570
↓ 85 callers
Method
Do
(any)
v1/ast/index.go:664
↓ 85 callers
Function
Unmarshal
Unmarshal decodes a YAML, JSON or JSON extension value into the specified type.
v1/util/json.go:178
↓ 83 callers
Method
Diff
(Set)
v1/ast/term.go:1804
↓ 82 callers
Method
Compile
Compile runs the compilation process on the input modules. The compiled version of the modules and associated data structures are stored on the compil
v1/ast/compile.go:670
↓ 82 callers
Function
module
FIXME(v1-test-refactor): In OPA 1.0, a call to here can be replaced with a call to MustParseModule.
v1/ast/compile_test.go:12729
↓ 79 callers
Function
NewSet
NewSet returns a new Set containing t.
v1/ast/term.go:1819
↓ 79 callers
Function
NewStaticProperty
NewStaticProperty returns a new StaticProperty object.
v1/types/types.go:310
↓ 78 callers
Method
Insert
(key ast.Value, value InterQueryCacheValue)
v1/topdown/cache/cache.go:252
↓ 78 callers
Method
Start
(context.Context)
v1/plugins/bundle/plugin.go:51
↓ 78 callers
Function
Txn
Txn is a convenience function that executes f inside a new transaction opened on the store. If the function returns an error, the transaction is abort
v1/storage/storage.go:95
↓ 77 callers
Method
Printf
Printf prints, with a short file:line-number prefix
internal/debug/debug.go:11
↓ 77 callers
Method
WithTransaction
WithTransaction sets the transaction to use for the query. All queries should be performed over a consistent snapshot of the storage layer.
v1/topdown/query.go:107
↓ 76 callers
Function
MustParseExpr
MustParseExpr returns a parsed expression. If an error occurs during parsing, panic.
v1/ast/parser_ext.go:41
↓ 74 callers
Method
Call
Call creates a new term for the built-in with the given operands.
v1/ast/builtins.go:3654
↓ 74 callers
Function
modules
(ms ...string)
v1/ast/compile_test.go:12715
↓ 73 callers
Method
Hash
Find returns value referred to by path or an error if path is not found.
v1/ast/term.go:64
↓ 73 callers
Method
oneShot
(ctx context.Context, name string, u download.Update)
v1/plugins/bundle/plugin.go:478
↓ 72 callers
Method
Commit
Commit is called to finish the transaction. If Commit returns an error, the transaction must be automatically aborted by the Store implementation.
v1/storage/interface.go:35
↓ 72 callers
Method
WithFields
(map[string]any)
v1/logging/logging.go:36
↓ 72 callers
Function
assertEq
quick and dirty assertions
v1/plugins/rest/aws_test.go:39
↓ 71 callers
Function
NewJSONDecoder
NewJSONDecoder returns a new decoder that reads from r. This function is intended to be used in place of the standard [json.NewDecoder] when [json.Nu
v1/util/json.go:54
↓ 71 callers
Function
NewNoOpLogger
NewNoOpLogger instantiates new NoOpLogger
v1/logging/logging.go:188
↓ 70 callers
Method
Register
(context.Context, Transaction, TriggerConfig)
v1/storage/interface.go:235
↓ 70 callers
Method
ServeHTTP
(w http.ResponseWriter, _ *http.Request)
v1/server/server_test.go:6975
↓ 69 callers
Function
MustWriteTarGz
MustWriteTarGz writes the list of file names and content into a tarball. Paths are prefixed with "/".
internal/file/archive/tarball.go:59
↓ 68 callers
Function
CapabilitiesRegoVersion
(regoVersion RegoVersion)
v1/ast/capabilities.go:125
↓ 68 callers
Method
Value
()
v1/metrics/metrics.go:210
↓ 67 callers
Method
Info
(fmt string, a ...any)
v1/logging/logging.go:32
↓ 67 callers
Method
WithCancel
WithCancel sets the cancellation object to use for the query. Set this if you need to abort queries based on a deadline. This is optional.
v1/topdown/query.go:114
↓ 66 callers
Method
IsGround
Returns hash code of the value.
v1/ast/term.go:65
↓ 66 callers
Method
scan
()
v1/ast/parser.go:2900
↓ 65 callers
Function
NewFileLoader
NewFileLoader returns a new FileLoader instance.
v1/loader/loader.go:113
↓ 64 callers
Method
All
()
v1/metrics/metrics.go:57
↓ 64 callers
Method
Build
Build tries to construct an index for the given rules. If the index was constructed, it returns true, otherwise false.
v1/ast/index.go:21
↓ 64 callers
Function
SetTerm
SetTerm returns a new Term representing a set containing terms t.
v1/ast/term.go:1847
↓ 64 callers
Method
Walk
Walk iterates the AST by calling the function f on the [VarVisitor] before recursing. Contrary to the deprecated [Walk] function, this does not requir
v1/ast/visit.go:921
↓ 63 callers
Method
Slice
()
v1/ast/term.go:1815
↓ 62 callers
Function
New
New returns a new Downloader that can be started.
v1/download/download.go:83
↓ 62 callers
Method
WriteFile
(path string, bs []byte)
internal/file/archive/tarball.go:29
↓ 62 callers
Function
newFixture
(t *testing.T, opts ...any)
v1/server/server_test.go:5448
↓ 61 callers
Method
Encode
Encode attempts to write an encoded event to the current chunk. A chunk is returned when it reaches the uncompressed limit, the uncompressed limit is
v1/plugins/logs/encoder.go:103
↓ 61 callers
Function
ErrorAuto
ErrorAuto writes a response with status and code set automatically based on the type of err.
v1/server/writer/writer.go:27
↓ 61 callers
Method
function
(name string)
internal/compiler/wasm/wasm.go:1729
↓ 60 callers
Function
NullTerm
NullTerm creates a new Term with a Null value.
v1/ast/term.go:717
↓ 60 callers
Method
Operand
Operand returns the term at the zero-based pos. If the expr does not include at least pos+1 terms, this function returns nil.
v1/ast/policy.go:1458
↓ 60 callers
Function
newRepl
(store storage.Store, buffer *bytes.Buffer)
v1/repl/repl_test.go:3381
↓ 59 callers
Method
Stop
(context.Context)
v1/plugins/bundle/plugin.go:52
↓ 59 callers
Method
StringLength
()
v1/ast/string_length.go:14
↓ 59 callers
Method
UpsertPolicy
(context.Context, Transaction, string, []byte)
v1/storage/interface.go:154
↓ 59 callers
Function
assertParseOneExpr
(t *testing.T, msg string, input string, correct *Expr, opts ...ParserOptions)
v1/ast/parser_test.go:8449
↓ 59 callers
Function
ensurePluginState
(t *testing.T, p *Plugin, state plugins.State)
v1/plugins/bundle/plugin_test.go:7806
↓ 59 callers
Method
newLocal
()
internal/planner/planner.go:2392
↓ 58 callers
Function
Compare
Compare returns -1, 0, 1 based on comparison between a and b.
v1/types/types.go:885
↓ 58 callers
Method
Counter
(name string)
v1/metrics/metrics.go:56
↓ 58 callers
Function
newReqV1
(method string, path string, body string)
v1/server/server_test.go:5690
↓ 57 callers
Method
Find
Compare returns <0, 0, or >0 if this Value is less than, equal to, or greater than other, respectively.
v1/ast/term.go:63
↓ 57 callers
Function
MustParseRule
MustParseRule returns a parsed rule. If an error occurs during parsing, panic.
v1/ast/parser_ext.go:135
↓ 57 callers
Function
New
New returns a new disk-based store based on the provided options.
v1/storage/disk/disk.go:138
↓ 57 callers
Function
newEvalCommandParams
()
cmd/eval.go:93
↓ 57 callers
Function
op
(v ir.Val)
internal/planner/planner.go:2614
↓ 57 callers
Method
v1
(method string, path string, body string, code int, resp string)
v1/server/server_test.go:5567
↓ 56 callers
Method
Get
(key ast.Value)
v1/topdown/cache/cache.go:251
↓ 55 callers
Method
NewTransaction
NewTransaction is called create a new transaction in the store.
v1/storage/interface.go:25
↓ 55 callers
Method
appendInstr
(instr instruction.Instruction)
internal/compiler/wasm/wasm.go:1737
↓ 55 callers
Method
local
(l ir.Local)
internal/compiler/wasm/wasm.go:1712
↓ 54 callers
Method
Bytes
Bytes returns a slice of the contents of the bit vector. If the caller changes the returned slice, the contents of the bit vector may change.
internal/edittree/bitvector/bitvector.go:42
↓ 54 callers
Method
Elem
(t *ast.Term)
v1/topdown/cache.go:263
↓ 54 callers
Function
New
New returns a new Plugin with the given config.
v1/plugins/bundle/plugin.go:76
↓ 54 callers
Method
New
New creates a new JSON loader for the given source
internal/gojsonschema/jsonLoader.go:89
↓ 53 callers
Function
MustMarshalJSON
MustMarshalJSON returns the JSON encoding of x If the data cannot be encoded, this function will panic. This function is for test purposes.
v1/util/json.go:76
↓ 53 callers
Function
assertParseError
(t *testing.T, msg string, input string, opts ...ParserOptions)
v1/ast/parser_test.go:8309
↓ 52 callers
Method
Close
(context.Context)
v1/storage/interface.go:62
↓ 52 callers
Method
URL
URL returns the base URL of the server.
v1/sdk/test/test.go:130
↓ 51 callers
Method
Entries
Entries returns buffered log entries.
v1/logging/test/test.go:90
↓ 51 callers
Method
Err
()
v1/topdown/eval_test.go:1577
↓ 51 callers
Method
WithRegoVersion
(ast.RegoVersion)
v1/loader/loader.go:108
↓ 51 callers
Function
eval
(args []string, params evalCommandParams, w io.Writer, stderr io.Writer)
cmd/eval.go:375
↓ 51 callers
Function
makeDataBundle
(n int, s string)
v1/plugins/discovery/discovery_test.go:3337
↓ 51 callers
Method
reset
()
v1/server/server_test.go:5625
↓ 50 callers
Function
Compare
Compare returns an integer indicating whether two AST values are less than, equal to, or greater than each other. If a is less than b, the return val
v1/ast/compare.go:40
↓ 50 callers
Function
NewHead
NewHead returns a new Head object. If args are provided, the first will be used for the key and the second will be used for the value.
v1/ast/policy.go:790
↓ 50 callers
Method
Type
Type returns the type of the variable.
v1/debug/variable.go:21
↓ 50 callers
Function
Walk
Walk iterates the AST by calling the Visit function on the [Visitor] v for x before recursing. Deprecated: use [GenericVisitor.Walk]
v1/ast/visit.go:97
↓ 49 callers
Method
Client
Client returns a client for communicating with a remote service.
v1/plugins/plugins.go:1226
↓ 49 callers
Function
New
New returns a new compiler instance that can be invoked.
v1/compile/compile.go:95
↓ 49 callers
Function
New
New returns a new Client for config.
v1/plugins/rest/rest.go:191
↓ 49 callers
Method
Pop
Pop pops the top frame of value mappings from the stack, removing all associated entries.
v1/topdown/cache.go:23
↓ 49 callers
Function
compileStages
compileStages is a helper function to run compiler up to a given stage. If stageID is empty, a normal full compile run is performed. This works direct
v1/ast/compile_test.go:11713
← previous
next →
101–200 of 11,070, ranked by callers