Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDuplicatePolicy signals that there are duplicate policy definitions. ErrDuplicatePolicy = errors.New("duplicate policy definitions") // ErrInvalidEntry signals that the index entry is invalid. ErrInvalidEntry = errors.New("invalid index entry") // ErrPolicyNotFound signals that the policy does not exist. ErrPolicyNotFound = errors.New("policy not found") )
Functions ¶
This section is empty.
Types ¶
type BuildError ¶
type BuildError struct { *runtimev1.IndexBuildErrors // contains filtered or unexported fields }
BuildError is an error type that contains details about the failures encountered during the index build.
func (*BuildError) Error ¶
func (ibe *BuildError) Error() string
type BuildOpt ¶
type BuildOpt func(*buildOptions)
func WithBuildFailureLogLevel ¶ added in v0.19.0
func WithRootDir ¶
func WithSourceAttributes ¶ added in v0.33.0
func WithSourceAttributes(attrs ...policy.SourceAttribute) BuildOpt
type Index ¶
type Index interface { io.Closer storage.Instrumented GetFirstMatch([]namer.ModuleID) (*policy.CompilationUnit, error) GetCompilationUnits(...namer.ModuleID) (map[namer.ModuleID]*policy.CompilationUnit, error) GetDependents(...namer.ModuleID) (map[namer.ModuleID][]namer.ModuleID, error) AddOrUpdate(Entry) (storage.Event, error) Delete(Entry) (storage.Event, error) GetFiles() []string GetAllCompilationUnits(context.Context) <-chan *policy.CompilationUnit Clear() error InspectPolicies(context.Context) (map[string]*responsev1.InspectPoliciesResponse_Result, error) ListPolicyIDs(context.Context) ([]string, error) ListSchemaIDs(context.Context) ([]string, error) LoadSchema(context.Context, string) (io.ReadCloser, error) LoadPolicy(context.Context, ...string) ([]*policy.Wrapper, error) Reload(ctx context.Context) ([]storage.Event, error) }
type ModuleIDSet ¶ added in v0.34.0
type SchemaLoader ¶ added in v0.11.0
type SchemaLoader struct {
// contains filtered or unexported fields
}
func NewSchemaLoader ¶ added in v0.11.0
func NewSchemaLoader(fsys fs.FS, rootDir string) *SchemaLoader
func (*SchemaLoader) ListIDs ¶ added in v0.18.0
func (sl *SchemaLoader) ListIDs(_ context.Context) ([]string, error)
func (*SchemaLoader) Load ¶ added in v0.11.0
func (sl *SchemaLoader) Load(_ context.Context, id string) (io.ReadCloser, error)
Click to show internal directories.
Click to hide internal directories.