graph

package
v0.0.0-...-7203340 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	// Field is the field in the root type from/to which the edge goes
	Field *load.Field
	// SrcField is the source field from which the edge goes from.
	// It can be in any node.
	SrcField     *load.Field
	RelationType *load.Type
}

Edge describes an edge in the graph

type Graph

type Graph struct {
	// AnnotatedType is the root type
	Type *load.Type
	// In are relations from other types to the root type
	// Out are relations from the root type to other types
	// RelTable are relations from a relation table to the root type
	In, Out, RelTable []Edge
}

Graph describes a relations graph from a root type. This graph has edges only from and to the root node. It could have more than one edge, in any direction between the root node and any other node.

func New

func New(tp *load.Type) (*Graph, error)

New returns a graph with a given root type

Jump to

Keyboard shortcuts

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