rulegraph

package
v0.0.0-...-c71e6cd Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitGraph

func EmitGraph(g *Graph, w io.Writer)

func LoadRuleFiles

func LoadRuleFiles(names ...string) ([]rulefmt.RuleGroup, error)

func LoadRulefile

func LoadRulefile(filename string) ([]rulefmt.RuleGroup, error)

Types

type Graph

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

Nodes and edges for a graph. This also has some internal data structures to facilitate walking the expression tree(s) of rules.

func BuildRuleDiagram

func BuildRuleDiagram(groups []rulefmt.RuleGroup) *Graph

Build a diagram of the interdependency of all rule files passed in. We expect that these have already been checked for errors and passed that check.

When we have processed these, simply serialise the graph as a DOT graph to w.

func (*Graph) Visit

func (g *Graph) Visit(node parser.Node, path []parser.Node) (parser.Visitor, error)

Method implementing the promql parser Visitor interface.

Jump to

Keyboard shortcuts

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