base

package
v0.0.0-...-bec77f0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2016 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector is a base implementation of a graph.Connector

func NewInputConnector

func NewInputConnector(name ...graph.ConnectorName) *Connector

NewInputConnector creates an input connector with the specified name. If no name is given, the default input name is used.

func NewOutputConnector

func NewOutputConnector(name ...graph.ConnectorName) *Connector

NewOutputConnector creates an output connector with the specified name. If no name is given, the default output name is used.

func (*Connector) Connect

func (c *Connector) Connect(target graph.Linker, connector graph.Connector) error

func (*Connector) Disconnect

func (c *Connector) Disconnect()

func (Connector) Name

func (c Connector) Name() graph.ConnectorName

func (Connector) Target

func (c Connector) Target() (graph.Linker, graph.Connector)

func (Connector) Type

func (c Connector) Type() graph.ConnectorType

type Linker

type Linker struct {
	// InputConnectors is a map of the input connectors using their names
	InputConnectors map[graph.ConnectorName]graph.Connector
	// OutputConnectors is a map of the output connectors using their names
	OutputConnectors map[graph.ConnectorName]graph.Connector

	// Data is the underlying Node
	Data graph.Node
}

Linker provides a base implementation of graph.Linker

func NewLinker

func NewLinker() *Linker

NewLinker creates a new linker with a node and adds the default input and output connectors

func NewLinkerNode

func NewLinkerNode(node graph.Node) *Linker

func (*Linker) Connect

func (l *Linker) Connect(target graph.Linker, source, sink graph.Connector) error

func (Linker) Connection

func (l Linker) Connection(source ...graph.Connector) (graph.Linker, graph.Connector)

func (Linker) Connector

func (l Linker) Connector(name graph.ConnectorName, kind ...graph.ConnectorType) graph.Connector

func (Linker) Connectors

func (l Linker) Connectors(kind ...graph.ConnectorType) []graph.Connector

func (*Linker) Disconnect

func (l *Linker) Disconnect(source graph.Connector)
func (l *Linker) Link(target graph.Linker)

func (Linker) Node

func (l Linker) Node() graph.Node
func (l *Linker) Unlink()

type Node

type Node struct {
	NodeId graph.Id
}

Node is a base implementation of a graph.Node

func NewNode

func NewNode() Node

NewNode creates a new node with an incremental id

func (Node) Id

func (n Node) Id() graph.Id

Jump to

Keyboard shortcuts

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