MCPcopy Create free account
hub / github.com/Permify/permify / NewCheckEngine

Function NewCheckEngine

internal/engines/check.go:38–52  ·  view source on GitHub ↗

NewCheckEngine creates a new CheckEngine instance for performing permission checks. It takes a key manager, schema reader, and relationship reader as parameters. Additionally, it allows for optional configuration through CheckOption function arguments.

(sr storage.SchemaReader, rr storage.DataReader, opts ...CheckOption)

Source from the content-addressed store, hash-verified

36// It takes a key manager, schema reader, and relationship reader as parameters.
37// Additionally, it allows for optional configuration through CheckOption function arguments.
38func NewCheckEngine(sr storage.SchemaReader, rr storage.DataReader, opts ...CheckOption) *CheckEngine {
39 // Initialize a CheckEngine with default concurrency limit and provided parameters
40 engine := &CheckEngine{
41 schemaReader: sr,
42 dataReader: rr,
43 concurrencyLimit: _defaultConcurrencyLimit,
44 }
45
46 // Apply provided options to configure the CheckEngine
47 for _, opt := range opts {
48 opt(engine)
49 }
50
51 return engine
52}
53
54// SetInvoker sets the delegate for the CheckEngine.
55func (engine *CheckEngine) SetInvoker(invoker invoke.Check) {

Callers 8

NewContainerFunction · 0.92
serveFunction · 0.92
gc_test.goFile · 0.92
check_test.goFile · 0.92
check_test.goFile · 0.85
lookup_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected