canvas

package
v0.0.0-...-9da2307 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermW = 1 << (1 + iota)
	PermR
)

Variables

View Source
var (
	Debug = util.Debug
	Info  = util.Info
	Warn  = util.Warn
	Error = util.Error
)

Functions

func DumpDotFile

func DumpDotFile(g Graph)

func NewBreadthFirst

func NewBreadthFirst(visit func(u, v Node), filter func(e Edge) bool) *traverse.BreadthFirst

func NewDepthFirst

func NewDepthFirst(visit func(u, v Node), filter func(e Edge) bool) *traverse.DepthFirst

Types

type Adapter

type Adapter interface {
	UUID() string
	FD() int
	Close()
	Type() string
	Name() string
	Tags() []string
	Perm() uint
	Config() map[string]interface{}
	SetConfig(req api.ModuleBase, g Graph, id int) error
	Tables() []map[string]interface{}
	Table(name string) AdapterTable
}

func NewAdapter

func NewAdapter(req api.ModuleBase, g Graph, id int) (adapter Adapter, err error)

type AdapterNode

type AdapterNode struct {
	NodeBase
	// contains filtered or unexported fields
}

func NewAdapterNode

func NewAdapterNode(adapter Adapter) *AdapterNode

func (*AdapterNode) Adapter

func (n *AdapterNode) Adapter() Adapter

func (*AdapterNode) Close

func (n *AdapterNode) Close()

type AdapterTable

type AdapterTable interface {
	ID() string
	Name() string
	Config() map[string]interface{}
	Get(key string) (interface{}, bool)
	Set(key, val string) error
	Delete(key string) error
	Iter() <-chan api.ModuleTableEntry
}

type BpfAdapter

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

func NewBpfAdapter

func NewBpfAdapter(uuid, name string, b *bpf.BpfModule) *BpfAdapter

func (*BpfAdapter) Close

func (adapter *BpfAdapter) Close()

func (*BpfAdapter) Config

func (adapter *BpfAdapter) Config() map[string]interface{}

func (*BpfAdapter) FD

func (adapter *BpfAdapter) FD() int

func (*BpfAdapter) Init

func (adapter *BpfAdapter) Init() error

func (*BpfAdapter) Name

func (adapter *BpfAdapter) Name() string

func (*BpfAdapter) Perm

func (adapter *BpfAdapter) Perm() uint

func (*BpfAdapter) SetConfig

func (adapter *BpfAdapter) SetConfig(req api.ModuleBase, g Graph, id int) error

func (*BpfAdapter) Table

func (adapter *BpfAdapter) Table(name string) AdapterTable

func (*BpfAdapter) Tables

func (adapter *BpfAdapter) Tables() []map[string]interface{}

func (*BpfAdapter) Tags

func (adapter *BpfAdapter) Tags() []string

func (*BpfAdapter) Type

func (adapter *BpfAdapter) Type() string

func (*BpfAdapter) UUID

func (adapter *BpfAdapter) UUID() string

type BridgeAdapter

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

func NewBridgeAdapter

func NewBridgeAdapter(link *netlink.Bridge) *BridgeAdapter

func (*BridgeAdapter) Close

func (ba *BridgeAdapter) Close()

func (*BridgeAdapter) Config

func (ba *BridgeAdapter) Config() map[string]interface{}

func (*BridgeAdapter) FD

func (ba *BridgeAdapter) FD() int

func (*BridgeAdapter) Name

func (ba *BridgeAdapter) Name() string

func (*BridgeAdapter) Perm

func (ba *BridgeAdapter) Perm() uint

func (*BridgeAdapter) SetConfig

func (ba *BridgeAdapter) SetConfig(req api.ModuleBase, g Graph, id int) error

func (*BridgeAdapter) Table

func (ba *BridgeAdapter) Table(name string) AdapterTable

func (*BridgeAdapter) Tables

func (ba *BridgeAdapter) Tables() []map[string]interface{}

func (*BridgeAdapter) Tags

func (ba *BridgeAdapter) Tags() []string

func (*BridgeAdapter) Type

func (ba *BridgeAdapter) Type() string

func (*BridgeAdapter) UUID

func (ba *BridgeAdapter) UUID() string

type BridgeTable

type BridgeTable struct {
}

func (*BridgeTable) Config

func (table *BridgeTable) Config() map[string]interface{}

func (*BridgeTable) Delete

func (table *BridgeTable) Delete(key string) error

func (*BridgeTable) Get

func (table *BridgeTable) Get(key string) (interface{}, bool)

func (*BridgeTable) ID

func (table *BridgeTable) ID() string

func (*BridgeTable) Iter

func (table *BridgeTable) Iter() <-chan api.ModuleTableEntry

func (*BridgeTable) Name

func (table *BridgeTable) Name() string

func (*BridgeTable) Set

func (table *BridgeTable) Set(key, val string) error

type DirectedGraph

type DirectedGraph struct {
	simple.DirectedGraph
	// contains filtered or unexported fields
}

func (*DirectedGraph) AddNode

func (g *DirectedGraph) AddNode(node graph.Node)

func (*DirectedGraph) Copy

func (g *DirectedGraph) Copy(src Graph)

func (*DirectedGraph) E

func (g *DirectedGraph) E(u, v graph.Node) Edge

func (*DirectedGraph) HasPath

func (g *DirectedGraph) HasPath(path string) bool

func (*DirectedGraph) Node

func (g *DirectedGraph) Node(id int) Node

func (*DirectedGraph) NodeByPath

func (g *DirectedGraph) NodeByPath(path string) Node

func (*DirectedGraph) RemoveEdge

func (g *DirectedGraph) RemoveEdge(e Edge)

func (*DirectedGraph) RemoveNode

func (g *DirectedGraph) RemoveNode(node graph.Node)

func (*DirectedGraph) SetEdge

func (g *DirectedGraph) SetEdge(e Edge)

type Edge

type Edge interface {
	graph.Edge
	F() NodeIfc
	T() NodeIfc
	Update([]NodeIfc, int, int) bool
	ChainEquals([]NodeIfc) bool
	Serialize() [4]int
	ID() string
	MarkDeleted()
	IsDeleted() bool
}

type EdgeChain

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

func NewEdgeChain

func NewEdgeChain(f, t Node, fp, tp *int) *EdgeChain

func (*EdgeChain) ChainEquals

func (e *EdgeChain) ChainEquals(dst []NodeIfc) bool

func (*EdgeChain) F

func (e *EdgeChain) F() NodeIfc

func (*EdgeChain) From

func (e *EdgeChain) From() graph.Node

func (*EdgeChain) ID

func (e *EdgeChain) ID() string

func (*EdgeChain) IsDeleted

func (e *EdgeChain) IsDeleted() bool

func (*EdgeChain) MarkDeleted

func (e *EdgeChain) MarkDeleted()

func (*EdgeChain) Serialize

func (e *EdgeChain) Serialize() [4]int

func (*EdgeChain) String

func (e *EdgeChain) String() string

func (*EdgeChain) T

func (e *EdgeChain) T() NodeIfc

func (*EdgeChain) To

func (e *EdgeChain) To() graph.Node

func (*EdgeChain) Update

func (e *EdgeChain) Update(chain []NodeIfc, fromIfc, toIfc int) bool

func (*EdgeChain) Weight

func (e *EdgeChain) Weight() float64

type Graph

type Graph interface {
	graph.Directed
	graph.NodeAdder
	graph.NodeRemover
	SetEdge(Edge)
	RemoveEdge(Edge)
	Degree(graph.Node) int
	Node(int) Node
	E(u, v graph.Node) Edge
	HasPath(path string) bool
	NodeByPath(path string) Node
}

func NewGraph

func NewGraph() Graph

type Interface

type Interface interface {
	ID() int
	Name() string
}

type Node

type Node interface {
	graph.Node
	FD() int
	String() string
	Path() string
	DOTID() string
	SetID(id int)
	NewInterfaceID() (int, error)
	ReleaseInterfaceID(id int)
	Groups() *intsets.Sparse
	Close()
}

type NodeBase

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

func NewNodeBase

func NewNodeBase(id, fd int, uuid, prefix string, nhandles uint) NodeBase

func (*NodeBase) Close

func (n *NodeBase) Close()

func (*NodeBase) DOTID

func (n *NodeBase) DOTID() string

func (*NodeBase) FD

func (n *NodeBase) FD() int

func (*NodeBase) Groups

func (n *NodeBase) Groups() *intsets.Sparse

func (*NodeBase) ID

func (n *NodeBase) ID() int

func (*NodeBase) NewInterfaceID

func (n *NodeBase) NewInterfaceID() (int, error)

func (*NodeBase) Path

func (n *NodeBase) Path() string

func (*NodeBase) ReleaseInterfaceID

func (n *NodeBase) ReleaseInterfaceID(id int)

func (*NodeBase) SetFD

func (n *NodeBase) SetFD(fd int)

func (*NodeBase) SetID

func (n *NodeBase) SetID(id int)

func (*NodeBase) String

func (n *NodeBase) String() string

type NodeIfc

type NodeIfc struct {
	N int
	I int
}

func (NodeIfc) ID

func (ni NodeIfc) ID() int

func (NodeIfc) Ifc

func (ni NodeIfc) Ifc() int

func (NodeIfc) Serialize

func (ni NodeIfc) Serialize() int

Jump to

Keyboard shortcuts

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