graph

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphTemplate

type GraphTemplate struct {
	*gdsexttree.Graph
}

GraphTemplate holds the graph template for images

func NewGraphTemplate

func NewGraphTemplate() *GraphTemplate

NewGraphTemplate creates a new graph template for images

func (*GraphTemplate) AddNode

func (m *GraphTemplate) AddNode(node GraphTemplateNoder) error

AddNode adds a node to the graph template

func (*GraphTemplate) AddRelationship

func (m *GraphTemplate) AddRelationship(parent, child GraphTemplateNoder) error

AddRelationship adds a relationship to the graph template

func (*GraphTemplate) Exists

func (m *GraphTemplate) Exists(name string) bool

Exists checks if a node exists in the graph template

func (*GraphTemplate) GetNode

func (m *GraphTemplate) GetNode(name string) GraphTemplateNoder

GetNode gets a node from the graph template

func (*GraphTemplate) HasCycles

func (m *GraphTemplate) HasCycles() bool

HasCycles checks if the graph template has cycles

func (*GraphTemplate) Iterate

func (m *GraphTemplate) Iterate() <-chan GraphTemplateNoder

Iterate return a channel that iterates over the graph template

type GraphTemplateFactory

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

GraphTemplateFactory is a factory for the graph template

func NewGraphTemplateFactory

func NewGraphTemplateFactory(isMock bool) *GraphTemplateFactory

NewGraphTemplateFactory creates a new graph template factory

func (*GraphTemplateFactory) NewGraphTemplate

func (f *GraphTemplateFactory) NewGraphTemplate() GraphTemplater

NewGraphTemplate creates a new graph template node

func (*GraphTemplateFactory) NewGraphTemplateNode

func (f *GraphTemplateFactory) NewGraphTemplateNode(name string) GraphTemplateNoder

NewGraphTemplateNode creates a new graph template node

type GraphTemplateNode

type GraphTemplateNode struct {
	*gdsexttree.Node
}

GraphTemplateNode is a node for the graph template

func NewGraphTemplateNode

func NewGraphTemplateNode(name string) *GraphTemplateNode

NewGraphTemplateNode creates a new graph template node

func (*GraphTemplateNode) AddChild

func (n *GraphTemplateNode) AddChild(child GraphTemplateNoder) error

AddChild adds a child to the graph template node

func (*GraphTemplateNode) AddItem

func (n *GraphTemplateNode) AddItem(item interface{})

AddItem adds a item to the graph template node

func (*GraphTemplateNode) AddParent

func (n *GraphTemplateNode) AddParent(parent GraphTemplateNoder) error

AddParent adds a parent to the graph template node

func (*GraphTemplateNode) Children

func (n *GraphTemplateNode) Children() []GraphTemplateNoder

Children returns the children of the graph template node

func (*GraphTemplateNode) Item

func (n *GraphTemplateNode) Item() interface{}

Item return node's item

func (*GraphTemplateNode) Name

func (n *GraphTemplateNode) Name() string

Name returns the name of the graph template node

func (*GraphTemplateNode) Parents

func (n *GraphTemplateNode) Parents() []GraphTemplateNoder

Parents returns the parents of the graph template node

type GraphTemplateNodeFactory

type GraphTemplateNodeFactory struct{}

GraphTemplateNodeFactory is a factory for the graph template

func NewGraphTemplateNodeFactory

func NewGraphTemplateNodeFactory() *GraphTemplateNodeFactory

NewGraphTemplateNodeFactory creates a new graph template factory

func (*GraphTemplateNodeFactory) NewGraphTemplateNode

func (f *GraphTemplateNodeFactory) NewGraphTemplateNode(isMock bool) GraphTemplater

NewGraphTemplate creates a new graph template node

type GraphTemplateNoder

type GraphTemplateNoder interface {
	AddChild(GraphTemplateNoder) error
	AddParent(GraphTemplateNoder) error
	AddItem(interface{})
	Name() string
	Item() interface{}
	Children() []GraphTemplateNoder
	Parents() []GraphTemplateNoder
}

GraphTemplateNoder is the interface for the graph template node

type GraphTemplater

type GraphTemplater interface {
	GetNode(string) GraphTemplateNoder
	AddNode(GraphTemplateNoder) error
	AddRelationship(GraphTemplateNoder, GraphTemplateNoder) error
	Exists(string) bool
	HasCycles() bool
	Iterate() <-chan GraphTemplateNoder
}

GraphTemplater is the interface for the graph template for images

type MockGraphTemplate

type MockGraphTemplate struct {
	mock.Mock
}

MockGraphTemplate mocks a graph template for images

func NewMockGraphTemplate

func NewMockGraphTemplate() *MockGraphTemplate

NewMockGraphTemplate creates a new graph template for images

func (*MockGraphTemplate) AddNode

func (m *MockGraphTemplate) AddNode(node GraphTemplateNoder) error

AddNode adds a node to the graph template

func (*MockGraphTemplate) AddRelationship

func (m *MockGraphTemplate) AddRelationship(parent, child GraphTemplateNoder) error

AddRelationship adds a relationship to the graph template

func (*MockGraphTemplate) Exists

func (m *MockGraphTemplate) Exists(name string) bool

Exists checks if a node exists in the graph template

func (*MockGraphTemplate) GetNode

func (m *MockGraphTemplate) GetNode(name string) GraphTemplateNoder

GetNode gets a node from the graph template

func (*MockGraphTemplate) HasCycles

func (m *MockGraphTemplate) HasCycles() bool

HasCycles checks if the graph template has cycles

func (*MockGraphTemplate) Iterate

func (m *MockGraphTemplate) Iterate() <-chan GraphTemplateNoder

Iterate return a channel that iterates over the graph template

type MockGraphTemplateNode

type MockGraphTemplateNode struct {
	mock.Mock
}

MockGraphTemplateNode is a mock of GraphTemplateNode

func NewMockGraphTemplateNode

func NewMockGraphTemplateNode() *MockGraphTemplateNode

NewMockGraphTemplateNode creates a new MockGraphTemplateNode

func (*MockGraphTemplateNode) AddChild

func (m *MockGraphTemplateNode) AddChild(child GraphTemplateNoder) error

AddChild adds a child to the graph template node

func (*MockGraphTemplateNode) AddItem

func (m *MockGraphTemplateNode) AddItem(item interface{})

AddItem adds a item to the graph template node

func (*MockGraphTemplateNode) AddParent

func (m *MockGraphTemplateNode) AddParent(parent GraphTemplateNoder) error

AddParent adds a parent to the graph template node

Jump to

Keyboard shortcuts

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