graph

package
v0.0.0-...-12d7af2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDOTpng

func WriteDOTpng(graph Graph, outputFile string) (string, error)

func WriteProtobuf

func WriteProtobuf(g Graph) (*gpb.Graph, error)

WriteGraph takes a graph and creates a protobuf representation of it

Types

type ArgumentNode

type ArgumentNode struct {
	Index    int
	Field    string
	Context  string
	FileData FileMetaData
	// contains filtered or unexported fields
}

ArgumentNode is a node representing a whistler InputSource for projector arguments

func (*ArgumentNode) Equals

func (n *ArgumentNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*ArgumentNode) ID

func (n *ArgumentNode) ID() int

ID returns the node ID

func (*ArgumentNode) String

func (n *ArgumentNode) String() string

type ConstBoolNode

type ConstBoolNode struct {
	Value    bool
	Context  string
	FileData FileMetaData
	// contains filtered or unexported fields
}

ConstBoolNode is a node representing a whistler constant bool

func (*ConstBoolNode) Equals

func (n *ConstBoolNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*ConstBoolNode) ID

func (n *ConstBoolNode) ID() int

ID returns the node ID

func (*ConstBoolNode) String

func (n *ConstBoolNode) String() string

type ConstFloatNode

type ConstFloatNode struct {
	Value    float32
	Context  string
	FileData FileMetaData
	// contains filtered or unexported fields
}

ConstFloatNode is a node representing a whistler constant float

func (*ConstFloatNode) Equals

func (n *ConstFloatNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*ConstFloatNode) ID

func (n *ConstFloatNode) ID() int

ID returns the node ID

func (*ConstFloatNode) String

func (n *ConstFloatNode) String() string

type ConstIntNode

type ConstIntNode struct {
	Value    int
	Context  string
	FileData FileMetaData
	// contains filtered or unexported fields
}

ConstIntNode is a node representing a whistler constant int

func (*ConstIntNode) Equals

func (n *ConstIntNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*ConstIntNode) ID

func (n *ConstIntNode) ID() int

ID returns the node ID

func (*ConstIntNode) String

func (n *ConstIntNode) String() string

type ConstStringNode

type ConstStringNode struct {
	Value    string
	Context  string
	FileData FileMetaData
	// contains filtered or unexported fields
}

ConstStringNode is a node representing a whistler constant string

func (*ConstStringNode) Equals

func (n *ConstStringNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*ConstStringNode) ID

func (n *ConstStringNode) ID() int

ID returns the node ID

func (*ConstStringNode) String

func (n *ConstStringNode) String() string

type FileMetaData

type FileMetaData struct {
	FileName  string
	LineStart int
	LineEnd   int
	CharStart int
	CharEnd   int
}

FileMetaData represents file-specific meta data from whistle or json

type Graph

type Graph struct {
	Edges             map[int][]int
	ArgumentEdges     map[int][]int
	ConditionEdges    map[int][]int
	RootAndOutTargets map[string][]int
	Nodes             map[int]Node
	// contains filtered or unexported fields
}

Graph is a map-basd adjacency list for storing a lineage graph. It contains the main adjacency list, Edges, for normal edges. For projector argument edges, it contains the ArgumentEdges adjacency list. It also contains a lookup dictionary of all nodes in the graph.

func New

func New(mpc *mbp.MappingConfig) (Graph, error)

New uses a whistler MappingConfig to generate a new lineage graph.

func (Graph) String

func (g Graph) String() string

type Node

type Node interface {
	ID() int

	Equals(Node) bool
	// contains filtered or unexported methods
}

Node represents a node in the lineage graph. Implementations are:

  • TargetNode
  • ConstNodes (ConstBoolNode, ConstStringNode, ConstIntNode, ConstFloatNode)
  • ProjectorNode
  • ArgumentNode
  • RootNode

type ProjectorNode

type ProjectorNode struct {
	Name      string
	Context   string
	IsBuiltin bool
	FileData  FileMetaData
	// contains filtered or unexported fields
}

ProjectorNode is a node representing a whistler projector definition

func (*ProjectorNode) Equals

func (n *ProjectorNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*ProjectorNode) ID

func (n *ProjectorNode) ID() int

ID returns the node ID

func (*ProjectorNode) String

func (n *ProjectorNode) String() string

type RootNode

type RootNode struct {
	Field    string
	Context  string
	FileData FileMetaData
	// contains filtered or unexported fields
}

func (*RootNode) Equals

func (n *RootNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*RootNode) ID

func (n *RootNode) ID() int

ID returns the node ID

func (*RootNode) String

func (n *RootNode) String() string

type TargetNode

type TargetNode struct {
	Name        string
	Context     string
	IsVariable  bool
	IsOverwrite bool
	IsRoot      bool
	IsOut       bool
	FileData    FileMetaData
	// contains filtered or unexported fields
}

TargetNode is a node representing a whistler target

func (*TargetNode) Equals

func (n *TargetNode) Equals(n2 Node) bool

Equals returns whether the nodes are equal

func (*TargetNode) ID

func (n *TargetNode) ID() int

ID returns the node ID

func (*TargetNode) String

func (n *TargetNode) String() string

Jump to

Keyboard shortcuts

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