Documentation ¶
Overview ¶
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
* Copyright © 2020. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file.
Index ¶
- func Hash(key []interface{}) string
- func IsSimpleType(val interface{}) bool
- func ToString(attribute *Attribute) string
- type Attribute
- type Attributefinition
- type BaseEntity
- type DataType
- type Edge
- type EdgeDefinition
- type EdgeDirection
- type EdgeId
- type Entity
- type EntityDefinition
- type EntityId
- type Graph
- type GraphBuilder
- func (builder *GraphBuilder) BuildEdge(graph *Graph, model *GraphDefinition, nodeMap map[string]*Node, ...)
- func (builder *GraphBuilder) BuildGraph(graph *Graph, model *GraphDefinition, iNodes interface{}, iEdges interface{}, ...) error
- func (builder *GraphBuilder) BuildGraphLegacy(graph *Graph, model *GraphDefinition, nodes interface{}, edges interface{}, ...)
- func (builder *GraphBuilder) BuildNode(graph *Graph, model *GraphDefinition, nodeType string, ...) *Node
- func (builder *GraphBuilder) CreateGraph(graphId string, model *GraphDefinition) Graph
- func (builder *GraphBuilder) CreateUndefinedGraph(modelId string, graphId string) Graph
- func (builder *GraphBuilder) Export(g *Graph, graphModel *GraphDefinition) map[string]interface{}
- type GraphDefinition
- func (gd *GraphDefinition) Export() map[string]interface{}
- func (gd *GraphDefinition) GetEdgeDefinition(edgeType string) *EdgeDefinition
- func (gd *GraphDefinition) GetEdgeDefinitions() map[string]*EdgeDefinition
- func (gd *GraphDefinition) GetId() string
- func (gd *GraphDefinition) GetNodeDefinition(nodeType string) *NodeDefinition
- func (gd *GraphDefinition) GetNodeDefinitions() map[string]*NodeDefinition
- type GraphImpl
- func (g *GraphImpl) Clear()
- func (g *GraphImpl) GetEdge(id EdgeId) *Edge
- func (g *GraphImpl) GetEdges() map[EdgeId]*Edge
- func (g *GraphImpl) GetEntityKeyNamesForEdge(edgeType string) []string
- func (g *GraphImpl) GetEntityKeyNamesForNode(nodeType string) []string
- func (g *GraphImpl) GetId() string
- func (g *GraphImpl) GetModel() map[string]interface{}
- func (g *GraphImpl) GetModelId() string
- func (g *GraphImpl) GetNode(id NodeId) *Node
- func (g *GraphImpl) GetNodeByTypeByKey(nodeType string, nodeId NodeId) *Node
- func (g *GraphImpl) GetNodes() map[NodeId]*Node
- func (g *GraphImpl) GetNodesByType(nodeType string) map[NodeId]*Node
- func (g *GraphImpl) Merge(graph Graph)
- func (g *GraphImpl) SetEdge(id EdgeId, edge *Edge)
- func (g *GraphImpl) SetModel(model map[string]interface{})
- func (g *GraphImpl) SetNode(id NodeId, node *Node)
- func (g *GraphImpl) UpsertEdge(edgeType string, edgeKey []interface{}, fromNode *Node, toNode *Node) *Edge
- func (g *GraphImpl) UpsertEdgeToo(edge *Edge)
- func (g *GraphImpl) UpsertGraph(graph map[string]interface{})
- func (g *GraphImpl) UpsertNode(nodeType string, nodeKey []interface{}) *Node
- func (g *GraphImpl) UpsertNodeToo(node *Node)
- type GraphManager
- type GraphType
- type ManagableGraph
- type Node
- type NodeDefinition
- type NodeId
- type TraversalEdge
- type TraversalGraph
- func (g *TraversalGraph) Clear()
- func (g *TraversalGraph) GetEdge(id EdgeId) *TraversalEdge
- func (g *TraversalGraph) GetEdges() map[EdgeId]*TraversalEdge
- func (g *TraversalGraph) GetEntityKeyNamesForEdge(edgeType string) []string
- func (g *TraversalGraph) GetEntityKeyNamesForNode(nodeType string) []string
- func (g *TraversalGraph) GetId() string
- func (g *TraversalGraph) GetModel() map[string]interface{}
- func (g *TraversalGraph) GetModelId() string
- func (g *TraversalGraph) GetNode(id NodeId) *TraversalNode
- func (g *TraversalGraph) GetNodeByTypeByKey(nodeType string, nodeId NodeId) *TraversalNode
- func (g *TraversalGraph) GetNodes() map[NodeId]*TraversalNode
- func (g *TraversalGraph) GetNodesByType(nodeType string) map[NodeId]*TraversalNode
- func (g *TraversalGraph) SetEdge(id EdgeId, edge *TraversalEdge)
- func (g *TraversalGraph) SetModel(model map[string]interface{})
- func (g *TraversalGraph) SetNode(id NodeId, node *TraversalNode)
- func (g *TraversalGraph) UpsertEdge(edge *Edge, from *Node, to *Node)
- func (g *TraversalGraph) UpsertGraph(graph Graph)
- func (g *TraversalGraph) UpsertNode(node *Node) *TraversalNode
- type TraversalNode
- func (this *TraversalNode) GetAllEdges() map[string]*TraversalEdge
- func (this *TraversalNode) GetEdgeByType(edgeType string, outbound bool) map[string]*TraversalEdge
- func (this *TraversalNode) GetEdges(outbound bool) map[string]*TraversalEdge
- func (this *TraversalNode) SetEdge(edge *TraversalEdge, outbound bool) bool
- func (this *TraversalNode) Update(node *Node)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSimpleType ¶
func IsSimpleType(val interface{}) bool
Types ¶
type Attribute ¶
type Attribute struct {
// contains filtered or unexported fields
}
func NewAttribute ¶
func NewAttribute(attributeModel *Attributefinition, value interface{}) *Attribute
type Attributefinition ¶
type Attributefinition struct {
// contains filtered or unexported fields
}
func NewAttributeModel ¶
func NewAttributeModel(name string, dataTypeStr string) *Attributefinition
func (*Attributefinition) GetDataType ¶
func (this *Attributefinition) GetDataType() DataType
type BaseEntity ¶
type BaseEntity struct {
// contains filtered or unexported fields
}
func (*BaseEntity) GetAttribute ¶
func (e *BaseEntity) GetAttribute(name string) *Attribute
func (*BaseEntity) GetAttributes ¶
func (e *BaseEntity) GetAttributes() map[string]*Attribute
func (*BaseEntity) GetKey ¶
func (e *BaseEntity) GetKey() []interface{}
func (*BaseEntity) SetAttribute ¶
func (e *BaseEntity) SetAttribute(name string, attr *Attribute)
func (*BaseEntity) SetKey ¶
func (e *BaseEntity) SetKey(key []interface{})
type Edge ¶
type Edge struct { EdgeId BaseEntity // contains filtered or unexported fields }
func (*Edge) UpdateFrom ¶
type EdgeDefinition ¶
type EdgeDefinition struct { *EntityDefinition // contains filtered or unexported fields }
func NewEdgeModel ¶
func NewEdgeModel(edgeInfo map[string]interface{}) *EdgeDefinition
type EdgeDirection ¶
type EdgeDirection int
const ( Nondirectional EdgeDirection = 0 Directional EdgeDirection = 1 Bidirectional EdgeDirection = 2 )
func ToEdgeDirection ¶
func ToEdgeDirection(direction interface{}) (EdgeDirection, error)
func (EdgeDirection) String ¶
func (this EdgeDirection) String() string
type EntityDefinition ¶
type EntityDefinition struct {
// contains filtered or unexported fields
}
func NewEntityModel ¶
func NewEntityModel(entityInfo map[string]interface{}) *EntityDefinition
func (*EntityDefinition) GetAttributeDefinitions ¶
func (this *EntityDefinition) GetAttributeDefinitions() map[string]*Attributefinition
type EntityId ¶
type EntityId struct {
// contains filtered or unexported fields
}
func (*EntityId) GetKeyHash ¶
func (*EntityId) ToStringBuffer ¶
type Graph ¶
type Graph interface { GetId() string GetModelId() string GetModel() map[string]interface{} GetNodes() map[NodeId]*Node GetEdges() map[EdgeId]*Edge UpsertGraph(graph map[string]interface{}) UpsertNode(nodeType string, nodeKey []interface{}) *Node UpsertEdge(edgeType string, edgeKey []interface{}, fromNode *Node, toNode *Node) *Edge Merge(graph Graph) GetNodeByTypeByKey(nodeType string, nodeId NodeId) *Node GetNodesByType(nodeType string) map[NodeId]*Node GetEntityKeyNamesForNode(entityName string) []string GetEntityKeyNamesForEdge(entityName string) []string Clear() }
func ReconstructGraph ¶
type GraphBuilder ¶
type GraphBuilder struct {
// contains filtered or unexported fields
}
func NewGraphBuilder ¶
func NewGraphBuilder() *GraphBuilder
func (*GraphBuilder) BuildEdge ¶
func (builder *GraphBuilder) BuildEdge( graph *Graph, model *GraphDefinition, nodeMap map[string]*Node, edgeType string, attributesInfo map[string]interface{}, allowNullKey bool, )
func (*GraphBuilder) BuildGraph ¶
func (builder *GraphBuilder) BuildGraph( graph *Graph, model *GraphDefinition, iNodes interface{}, iEdges interface{}, allowNullKey bool, ) error
func (*GraphBuilder) BuildGraphLegacy ¶
func (builder *GraphBuilder) BuildGraphLegacy( graph *Graph, model *GraphDefinition, nodes interface{}, edges interface{}, allowNullKey bool, )
func (*GraphBuilder) BuildNode ¶
func (builder *GraphBuilder) BuildNode( graph *Graph, model *GraphDefinition, nodeType string, attributesInfo map[string]interface{}, allowNullKey bool, ) *Node
func (*GraphBuilder) CreateGraph ¶
func (builder *GraphBuilder) CreateGraph(graphId string, model *GraphDefinition) Graph
func (*GraphBuilder) CreateUndefinedGraph ¶
func (builder *GraphBuilder) CreateUndefinedGraph(modelId string, graphId string) Graph
func (*GraphBuilder) Export ¶
func (builder *GraphBuilder) Export(g *Graph, graphModel *GraphDefinition) map[string]interface{}
type GraphDefinition ¶
type GraphDefinition struct {
// contains filtered or unexported fields
}
func NewGraphModel ¶
func NewGraphModel(id string, graphmodel string) (*GraphDefinition, error)
func (*GraphDefinition) Export ¶
func (gd *GraphDefinition) Export() map[string]interface{}
func (*GraphDefinition) GetEdgeDefinition ¶
func (gd *GraphDefinition) GetEdgeDefinition(edgeType string) *EdgeDefinition
func (*GraphDefinition) GetEdgeDefinitions ¶
func (gd *GraphDefinition) GetEdgeDefinitions() map[string]*EdgeDefinition
func (*GraphDefinition) GetId ¶
func (gd *GraphDefinition) GetId() string
func (*GraphDefinition) GetNodeDefinition ¶
func (gd *GraphDefinition) GetNodeDefinition(nodeType string) *NodeDefinition
func (*GraphDefinition) GetNodeDefinitions ¶
func (gd *GraphDefinition) GetNodeDefinitions() map[string]*NodeDefinition
type GraphImpl ¶
type GraphImpl struct {
// contains filtered or unexported fields
}
func NewGraphImpl ¶
func (*GraphImpl) GetEntityKeyNamesForEdge ¶
func (*GraphImpl) GetEntityKeyNamesForNode ¶
func (*GraphImpl) GetModelId ¶
func (*GraphImpl) GetNodeByTypeByKey ¶
func (*GraphImpl) GetNodesByType ¶
func (*GraphImpl) UpsertEdge ¶
func (*GraphImpl) UpsertEdgeToo ¶
func (*GraphImpl) UpsertGraph ¶
func (*GraphImpl) UpsertNode ¶
func (*GraphImpl) UpsertNodeToo ¶
type GraphManager ¶
type GraphManager struct {
// contains filtered or unexported fields
}
func GetGraphManager ¶
func GetGraphManager() *GraphManager
func (*GraphManager) GetGraph ¶
func (this *GraphManager) GetGraph( graphType GraphType, modelId string, graphId string, ) ManagableGraph
type ManagableGraph ¶
type ManagableGraph interface { }
func CreateGraph ¶
func CreateGraph( graphType GraphType, modelId string, graphId string, ) ManagableGraph
type Node ¶
type Node struct { NodeId BaseEntity }
type NodeDefinition ¶
type NodeDefinition struct {
*EntityDefinition
}
func NewNodeModel ¶
func NewNodeModel(nodeInfo map[string]interface{}) *NodeDefinition
type TraversalEdge ¶
type TraversalEdge struct { Edge // contains filtered or unexported fields }
func NewTraversalEdge ¶
func NewTraversalEdge(edge *Edge, fromNode *TraversalNode, toNode *TraversalNode) *TraversalEdge
func (*TraversalEdge) GetAllNodes ¶
func (this *TraversalEdge) GetAllNodes() []*TraversalNode
func (*TraversalEdge) GetFromNode ¶
func (this *TraversalEdge) GetFromNode() *TraversalNode
func (*TraversalEdge) GetToNode ¶
func (this *TraversalEdge) GetToNode() *TraversalNode
func (*TraversalEdge) Update ¶
func (this *TraversalEdge) Update(edge *Edge)
type TraversalGraph ¶
type TraversalGraph struct {
// contains filtered or unexported fields
}
func NewTraversalGraph ¶
func NewTraversalGraph(modelId string, id string) *TraversalGraph
func (*TraversalGraph) Clear ¶
func (g *TraversalGraph) Clear()
func (*TraversalGraph) GetEdge ¶
func (g *TraversalGraph) GetEdge(id EdgeId) *TraversalEdge
func (*TraversalGraph) GetEdges ¶
func (g *TraversalGraph) GetEdges() map[EdgeId]*TraversalEdge
func (*TraversalGraph) GetEntityKeyNamesForEdge ¶
func (g *TraversalGraph) GetEntityKeyNamesForEdge(edgeType string) []string
func (*TraversalGraph) GetEntityKeyNamesForNode ¶
func (g *TraversalGraph) GetEntityKeyNamesForNode(nodeType string) []string
func (*TraversalGraph) GetId ¶
func (g *TraversalGraph) GetId() string
func (*TraversalGraph) GetModel ¶
func (g *TraversalGraph) GetModel() map[string]interface{}
func (*TraversalGraph) GetModelId ¶
func (g *TraversalGraph) GetModelId() string
func (*TraversalGraph) GetNode ¶
func (g *TraversalGraph) GetNode(id NodeId) *TraversalNode
func (*TraversalGraph) GetNodeByTypeByKey ¶
func (g *TraversalGraph) GetNodeByTypeByKey(nodeType string, nodeId NodeId) *TraversalNode
func (*TraversalGraph) GetNodes ¶
func (g *TraversalGraph) GetNodes() map[NodeId]*TraversalNode
func (*TraversalGraph) GetNodesByType ¶
func (g *TraversalGraph) GetNodesByType(nodeType string) map[NodeId]*TraversalNode
func (*TraversalGraph) SetEdge ¶
func (g *TraversalGraph) SetEdge(id EdgeId, edge *TraversalEdge)
func (*TraversalGraph) SetModel ¶
func (g *TraversalGraph) SetModel(model map[string]interface{})
func (*TraversalGraph) SetNode ¶
func (g *TraversalGraph) SetNode(id NodeId, node *TraversalNode)
func (*TraversalGraph) UpsertEdge ¶
func (g *TraversalGraph) UpsertEdge(edge *Edge, from *Node, to *Node)
func (*TraversalGraph) UpsertGraph ¶
func (g *TraversalGraph) UpsertGraph(graph Graph)
func (*TraversalGraph) UpsertNode ¶
func (g *TraversalGraph) UpsertNode(node *Node) *TraversalNode
type TraversalNode ¶
type TraversalNode struct { Node // contains filtered or unexported fields }
func NewTraversalNode ¶
func NewTraversalNode(node *Node) *TraversalNode
func (*TraversalNode) GetAllEdges ¶
func (this *TraversalNode) GetAllEdges() map[string]*TraversalEdge
func (*TraversalNode) GetEdgeByType ¶
func (this *TraversalNode) GetEdgeByType(edgeType string, outbound bool) map[string]*TraversalEdge
func (*TraversalNode) GetEdges ¶
func (this *TraversalNode) GetEdges(outbound bool) map[string]*TraversalEdge
func (*TraversalNode) SetEdge ¶
func (this *TraversalNode) SetEdge(edge *TraversalEdge, outbound bool) bool
func (*TraversalNode) Update ¶
func (this *TraversalNode) Update(node *Node)