Versions in this module Expand all Collapse all v0 v0.24.3 Jun 16, 2023 Changes in this version + const DefaultEvalTimeout + const DefaultInitTimeout + const DefaultQueryTimeout + var ErrEvalTimedOut = errors.New("evaluation timed out") + var ErrFailedToReadBundle = errors.New("failed to load bundle") + var ErrInitTimedOut = errors.New("initialization timed out") + var ErrQueryTimedOut = errors.New("query timed out") + var FailedToCompile = errors.New("Failed to compile rules") + var FailedToLoadRegoAPI = errors.New("Failed to load the w3security Rego API") + var FailedToLoadRules = errors.New("Failed to load rules") + type Engine struct + InitializationErrors []error + func NewEngine(ctx context.Context, options *EngineOptions) *Engine + func (e *Engine) Eval(ctx context.Context, options *EvalOptions) *models.Results + func (e *Engine) Metadata(ctx context.Context) ([]MetadataResult, error) + func (e *Engine) Query(ctx context.Context, options *QueryOptions) error + type EngineOptions struct + BundleReaders []bundle.Reader + Logger logging.Logger + Metrics metrics.Metrics + Providers []data.Provider + Timeouts Timeouts + type EvalOptions struct + Inputs []models.State + ResourcesResolver policy.ResourcesResolver + RuleIDs []string + Workers int + type MetadataResult struct + Error string + Metadata policy.Metadata + Package string + type PolicyConsumer struct + Document map[string]interface{} + Modules map[string]*ast.Module + NumDocuments int + func NewPolicyConsumer() *PolicyConsumer + func (c *PolicyConsumer) DataDocument(_ context.Context, path string, document map[string]interface{}) error + func (c *PolicyConsumer) Module(ctx context.Context, path string, module *ast.Module) error + type PolicySource string + const POLICY_SOURCE_BUNDLE_ARCHIVE + const POLICY_SOURCE_BUNDLE_DIRECTORY + const POLICY_SOURCE_DATA + type QueryOptions struct + Input *models.State + Query string + ResourcesResolver policy.ResourcesResolver + ResultProcessor func(ast.Value) error + type RuleBundleError struct + func (p *RuleBundleError) Error() string + func (p *RuleBundleError) ToModel() models.RuleBundleInfo + type Timeouts struct + Eval time.Duration + Init time.Duration + Query time.Duration