graph

package
v0.0.0-...-100f50b Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRAPH  = "GRAPH"
	VERTEX = "VERTEX"
	EDGE   = "EDGE"
)

Variables

This section is empty.

Functions

func GetElement

func GetElement(elemType, data string, elem interface{}) error

func GetElementType

func GetElementType(elem interface{}) string

func NewGraph

func NewGraph(interface{}) (error, uuid.UUID)

Types

type Edge

type Edge struct {
	Element
	Name       string
	SrcVertex  uuid.UUID
	DestVertex uuid.UUID
}

func E

func E(guuid, uid, src, dest uuid.UUID, name string, property ElementProperty) *Edge

func (*Edge) GetDestVertex

func (self *Edge) GetDestVertex() (error, Vertex)

func (*Edge) GetSrcVertex

func (self *Edge) GetSrcVertex() (error, Vertex)

func (*Edge) Json

func (self *Edge) Json() string

type EdgeInterface

type EdgeInterface interface {
	ElementInterface
	GetSrcVertex() (error, Vertex)
	GetDestVertex() (error, Vertex)
}

type Element

type Element struct {
	UUID       uuid.UUID
	GraphUUID  uuid.UUID
	Properties ElementProperty
}

func (*Element) GetGraphId

func (self *Element) GetGraphId() uuid.UUID

func (*Element) GetProperties

func (self *Element) GetProperties() (error, ElementProperty)

func (*Element) GetUUID

func (self *Element) GetUUID() uuid.UUID

func (*Element) Json

func (self *Element) Json() string

func (*Element) Remove

func (self *Element) Remove() error

func (*Element) SetProperties

func (self *Element) SetProperties(properties ElementProperty) error

func (*Element) String

func (self *Element) String() string

type ElementInterface

type ElementInterface interface {
	GetUUID() uuid.UUID
	GetGraphId() uuid.UUID
	GetProperties() (error, ElementProperty)
	SetProperties(props ElementProperty) error
	Remove() error

	Json() string
}

type ElementProperty

type ElementProperty map[string]string

type Graph

type Graph struct {
	UUID       uuid.UUID
	Properties interface{}
	Vertices   []Vertex
	Edges      []Edge
}

func GetGraph

func GetGraph(uuid uuid.UUID) Graph

func (*Graph) AddEdge

func (self *Graph) AddEdge(src Vertex, dest Vertex, properties ElementProperty) (error, Edge)

func (*Graph) AddVertex

func (self *Graph) AddVertex(properties ElementProperty) (error, Vertex)

func (*Graph) GetEdges

func (self *Graph) GetEdges() (error, []Edge)

func (*Graph) GetProperties

func (self *Graph) GetProperties() (error, ElementProperty)

func (*Graph) GetUUID

func (self *Graph) GetUUID() uuid.UUID

func (*Graph) GetVertices

func (self *Graph) GetVertices() (error, []Vertex)

type GraphInterface

type GraphInterface interface {
	GetUUID() uuid.UUID
	GetProperties() (error, ElementProperty)
	GetVertices() (error, []Vertex)
	GetEdges() (error, []Edge)
	AddVertex(properties ElementProperty) (error, Vertex)
	AddEdge(src Vertex, dest Vertex, properties ElementProperty) (error, Edge)
}

type Partition

type Partition struct {
	Id uuid.UUID
	// contains filtered or unexported fields
}

func (*Partition) Move

func (partition *Partition) Move(partitionInterface PartitionInterface) error

type PartitionInterface

type PartitionInterface interface {
	Move(partitionInterface PartitionInterface) error
}

type Vertex

type Vertex struct {
	Element
	OutEdges []Edge
	InEdges  []Edge
}

func V

func V(guuid, uuid uuid.UUID, property ElementProperty) *Vertex

func (*Vertex) GetChildVertices

func (self *Vertex) GetChildVertices(edgeLabels []string) (error, []Vertex)

func (*Vertex) GetInEdges

func (self *Vertex) GetInEdges(edgeLabels []string) (error, []Edge)

func (*Vertex) GetOutEdges

func (self *Vertex) GetOutEdges(edgeLabels []string) (error, []Edge)

func (*Vertex) GetParentVertices

func (self *Vertex) GetParentVertices(edgeLabels []string) (error, []Vertex)

func (*Vertex) Json

func (self *Vertex) Json() string

func (*Vertex) String

func (self *Vertex) String() string

type VertexInterface

type VertexInterface interface {
	ElementInterface
	GetInEdges(edgeLabels []string) (error, []Edge)
	GetOutEdges(edgeLabels []string) (error, []Edge)
	GetParentVertices(edgeLabels []string) (error, []Vertex)
	GetChildVertices(edgeLabels []string) (error, []Vertex)
}

Jump to

Keyboard shortcuts

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