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, )
| 77 | // It takes pointers to CheckEngine, ExpandEngine, LookupSchemaEngine, and LookupEntityEngine as arguments |
| 78 | // and returns an Invoker instance. |
| 79 | func 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, |
no test coverage detected