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

Function NewDirectInvoker

internal/invoke/invoke.go:79–100  ·  view source on GitHub ↗

NewDirectInvoker is a constructor for DirectInvoker. It takes pointers to CheckEngine, ExpandEngine, LookupSchemaEngine, and LookupEntityEngine as arguments and returns an Invoker instance.

(
	schemaReader storage.SchemaReader,
	dataReader storage.DataReader,
	cc Check,
	ec Expand,
	lo Lookup,
	sp SubjectPermission,
)

Source from the content-addressed store, hash-verified

77// It takes pointers to CheckEngine, ExpandEngine, LookupSchemaEngine, and LookupEntityEngine as arguments
78// and returns an Invoker instance.
79func NewDirectInvoker(
80 schemaReader storage.SchemaReader,
81 dataReader storage.DataReader,
82 cc Check,
83 ec Expand,
84 lo Lookup,
85 sp SubjectPermission,
86) *DirectInvoker {
87 return &DirectInvoker{
88 schemaReader: schemaReader,
89 dataReader: dataReader,
90 cc: cc,
91 ec: ec,
92 lo: lo,
93 sp: sp,
94 checkHistogram: telemetry.NewHistogram(internal.Meter, "check", "amount", "Number of checks"),
95
96 lookupEntityHistogram: telemetry.NewHistogram(internal.Meter, "lookup_entity", "amount", "Number of lookup entity"),
97 lookupSubjectHistogram: telemetry.NewHistogram(internal.Meter, "lookup_subject", "amount", "Number of lookup subject"),
98 subjectPermissionHistogram: telemetry.NewHistogram(internal.Meter, "subject_permission", "amount", "Number of subject permission"),
99 }
100}
101
102// Check is a method that implements the Check interface.
103// It calls the Run method of the CheckEngine with the provided context and PermissionCheckRequest,

Callers 9

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

Calls 1

NewHistogramFunction · 0.92

Tested by

no test coverage detected