chain

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) (*Chain, error)

func (*Chain) HandleAlert

func (x *Chain) HandleAlert(ctx context.Context, schema types.Schema, data any) ([]*model.Alert, error)

HandleAlert is main function of alert chain. It receives alert data and execute actions according to the Rego policies.

type Option added in v0.2.1

type Option func(c *Chain)

func WithActionMock added in v0.2.1

func WithActionMock(mock interfaces.ActionMock) Option

func WithDatabase added in v0.2.1

func WithDatabase(db interfaces.Database) Option

func WithEnablePrint added in v0.2.1

func WithEnablePrint() Option

func WithEnv added in v0.2.1

func WithEnv(f interfaces.Env) Option

func WithExtraAction added in v0.2.1

func WithExtraAction(name types.ActionName, action model.RunAction) Option

func WithPolicyAction added in v0.2.1

func WithPolicyAction(p *policy.Client) Option

func WithPolicyAlert added in v0.2.1

func WithPolicyAlert(p *policy.Client) Option

func WithScenarioRecorder added in v0.2.1

func WithScenarioRecorder(logger interfaces.ScenarioRecorder) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL