Documentation
¶
Overview ¶
Package interfaces contains the interfaces for the Minder policy engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvaluationResult ¶ added in v0.0.81
type EvaluationResult struct {
// Output is the output of the evaluation. This contains a list of additional
// information about the evaluation, which may be used in downstream actions.
Output any
}
EvaluationResult is the result of an evaluation
type Evaluator ¶
type Evaluator interface {
Eval(ctx context.Context, profile map[string]any, entity protoreflect.ProtoMessage, data *Ingested) (*EvaluationResult, error)
}
Evaluator is the interface for a rule type evaluator
type Ingested ¶ added in v0.0.89
type Ingested struct {
// Object is the object that was ingested. Normally comes from an external
// system like an HTTP server.
Object any
// Fs is the filesystem that was created as a result of the ingestion. This
// is normally used by the evaluator to do rule evaluation. The filesystem
// may be a git repo, or a memory filesystem.
Fs billy.Filesystem
// BaseFs is the base filesystem for a pull request. It can be used in the
// evaluator for diffing the PR target files against the base files.
BaseFs billy.Filesystem
// Storer is the git storer that was created as a result of the ingestion.
// FIXME: It might be cleaner to either wrap both Fs and Storer in a struct
// or pass out the git.Repository structure instead of the storer.
Storer storage.Storer
// Checkpoint is the checkpoint at which the ingestion was done. This is
// used to persist the state of the entity at ingestion time.
Checkpoint *checkpoints.CheckpointEnvelopeV1
}
Ingested is the result of an ingester
func (*Ingested) GetCheckpoint ¶ added in v0.0.89
func (r *Ingested) GetCheckpoint() *checkpoints.CheckpointEnvelopeV1
GetCheckpoint returns the checkpoint of the result
type Ingester ¶
type Ingester interface {
// Ingest does the actual data ingestion for a rule type
Ingest(ctx context.Context, ent protoreflect.ProtoMessage, params map[string]any) (*Ingested, error)
// GetType returns the type of the ingester
GetType() string
// GetConfig returns the config for the ingester
GetConfig() protoreflect.ProtoMessage
}
Ingester is the interface for a rule type ingester
type ResultSink ¶
type ResultSink interface {
SetIngestResult(*Ingested)
}
ResultSink sets the result of an ingestion
Click to show internal directories.
Click to hide internal directories.