engine

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

package engine implements generic correlation logic to correlate across domains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.6.2

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

Builder initializes the state of an engine. Engine() returns the immutable engine instance.

func Build added in v0.6.2

func Build() *Builder

func (*Builder) Apply added in v0.6.2

func (b *Builder) Apply(configs config.Configs) *Builder

Apply an engine.Builder.

func (*Builder) Domains added in v0.6.2

func (b *Builder) Domains(domains ...korrel8r.Domain) *Builder

func (*Builder) Engine added in v0.6.2

func (b *Builder) Engine() (*Engine, error)

Engine returns the final engine, which can no longer be modified. The Builder must not be used after calling Engine()

func (*Builder) Rules added in v0.6.2

func (b *Builder) Rules(rules ...korrel8r.Rule) *Builder

func (*Builder) StoreConfigs added in v0.6.2

func (b *Builder) StoreConfigs(storeConfigs ...config.Store) *Builder

func (*Builder) Stores added in v0.6.2

func (b *Builder) Stores(stores ...korrel8r.Store) *Builder

type Engine

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

Engine manages a set of rules and stores to perform correlation. Once created (see [Build()]) an engine is immutable.

func (*Engine) Class

func (e *Engine) Class(fullname string) (korrel8r.Class, error)

Class parses a full class name and returns the

func (*Engine) Domain

func (e *Engine) Domain(name string) korrel8r.Domain

Domain returns the named domain or nil if not found.

func (*Engine) DomainClass

func (e *Engine) DomainClass(domain, class string) (korrel8r.Class, error)

func (*Engine) DomainErr

func (e *Engine) DomainErr(name string) (korrel8r.Domain, error)

func (*Engine) Domains

func (e *Engine) Domains() []korrel8r.Domain

func (*Engine) Follower

func (e *Engine) Follower(ctx context.Context, c *korrel8r.Constraint) *Follower

Follower creates a follower. Constraint can be nil.

func (*Engine) Get

func (e *Engine) Get(ctx context.Context, q korrel8r.Query, constraint *korrel8r.Constraint, result korrel8r.Appender) error

Get results for query from all stores for the query domain.

func (*Engine) GoalSearch added in v0.6.0

func (e *Engine) GoalSearch(ctx context.Context, g *graph.Graph, start korrel8r.Class, objects []korrel8r.Object, queries []korrel8r.Query, constraint *korrel8r.Constraint, goals []korrel8r.Class) (*graph.Graph, error)

GoalSearch does a goal directed search from starting objects and queries, and returns the result graph.

func (*Engine) Graph

func (e *Engine) Graph() *graph.Graph

Graph creates a new graph of the engine's rules.

func (*Engine) Neighbours added in v0.6.0

func (e *Engine) Neighbours(ctx context.Context, start korrel8r.Class, objects []korrel8r.Object, queries []korrel8r.Query, constraint *korrel8r.Constraint, depth int) (*graph.Graph, error)

Neighbours generates a neighbourhood graph from starting objects and queries.

func (*Engine) Query added in v0.5.0

func (e *Engine) Query(query string) (korrel8r.Query, error)

Query parses a query string to a query object.

func (*Engine) Rule added in v0.6.2

func (e *Engine) Rule(name string) korrel8r.Rule

func (*Engine) Rules

func (e *Engine) Rules() []korrel8r.Rule

func (*Engine) Start added in v0.6.0

func (e *Engine) Start(ctx context.Context, start *graph.Node, objects []korrel8r.Object, queries []korrel8r.Query, constraint *korrel8r.Constraint) error

Start populates the start node for with objects and results of queries. Queries and objects must be of the same class as the node.

func (*Engine) StoreConfigsFor

func (e *Engine) StoreConfigsFor(d korrel8r.Domain) []config.Store

StoreConfigsFor returns the expanded store configurations and status.

func (*Engine) TemplateFuncs

func (e *Engine) TemplateFuncs() map[string]any

TemplateFuncs returns template helper functions for stores and domains known to this engine. See text/template.Template.Funcs

type Follower

type Follower struct {
	Engine     *Engine
	Context    context.Context
	Constraint *korrel8r.Constraint
	Err        error // Collect errors using errors.Join
	// contains filtered or unexported fields
}

Follower provides Vist() and Traverse() methods to follow rules and collect results in a graph.

func (*Follower) Traverse

func (f *Follower) Traverse(l *graph.Line) bool

Traverse a line gets all queries provided by Visit() on the From node, and stores results on the To node.

Jump to

Keyboard shortcuts

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