Documentation ¶
Overview ¶
package engine implements generic correlation logic to correlate across domains.
Index ¶
- type Builder
- func (b *Builder) Apply(configs config.Configs) *Builder
- func (b *Builder) Domains(domains ...korrel8r.Domain) *Builder
- func (b *Builder) Engine() (*Engine, error)
- func (b *Builder) Rules(rules ...korrel8r.Rule) *Builder
- func (b *Builder) StoreConfigs(storeConfigs ...config.Store) *Builder
- func (b *Builder) Stores(stores ...korrel8r.Store) *Builder
- type Engine
- func (e *Engine) Class(fullname string) (korrel8r.Class, error)
- func (e *Engine) Domain(name string) korrel8r.Domain
- func (e *Engine) DomainClass(domain, class string) (korrel8r.Class, error)
- func (e *Engine) DomainErr(name string) (korrel8r.Domain, error)
- func (e *Engine) Domains() []korrel8r.Domain
- func (e *Engine) Follower(ctx context.Context, c *korrel8r.Constraint) *Follower
- func (e *Engine) Get(ctx context.Context, q korrel8r.Query, constraint *korrel8r.Constraint, ...) error
- func (e *Engine) GoalSearch(ctx context.Context, g *graph.Graph, start korrel8r.Class, ...) (*graph.Graph, error)
- func (e *Engine) Graph() *graph.Graph
- func (e *Engine) Neighbours(ctx context.Context, start korrel8r.Class, objects []korrel8r.Object, ...) (*graph.Graph, error)
- func (e *Engine) Query(query string) (korrel8r.Query, error)
- func (e *Engine) Rule(name string) korrel8r.Rule
- func (e *Engine) Rules() []korrel8r.Rule
- func (e *Engine) Start(ctx context.Context, start *graph.Node, objects []korrel8r.Object, ...) error
- func (e *Engine) StoreConfigsFor(d korrel8r.Domain) []config.Store
- func (e *Engine) TemplateFuncs() map[string]any
- type Follower
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 (*Builder) Engine ¶ added in v0.6.2
Engine returns the final engine, which can no longer be modified. The Builder must not be used after calling Engine()
func (*Builder) StoreConfigs ¶ added in v0.6.2
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) DomainClass ¶
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) 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) 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 ¶
StoreConfigsFor returns the expanded store configurations and status.
func (*Engine) TemplateFuncs ¶
TemplateFuncs returns template helper functions for stores and domains known to this engine. See text/template.Template.Funcs