cluster

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFormat = errors.New("invalid format")
	ErrInvalidRange  = errors.New("invalid range")
	ErrPortCollision = errors.New("ports collision")
)

Functions

This section is empty.

Types

type Layers

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

func NewLayers

func NewLayers(
	b graph.NamedBuilderWriter,
	s float64,
) *Layers

func (*Layers) AddEdge

func (l *Layers) AddEdge(src, dst string, p *node.Port)

func (*Layers) AddNode

func (l *Layers) AddNode(n *node.Node) error

func (*Layers) Name

func (l *Layers) Name() string

func (*Layers) Write

func (l *Layers) Write(w io.Writer) error

type PortGrouper

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

func NewGrouper

func NewGrouper(
	similarity float64,
) *PortGrouper

func (*PortGrouper) Add

func (pg *PortGrouper) Add(
	key string,
	ports node.Ports,
)

func (*PortGrouper) IterGroups

func (pg *PortGrouper) IterGroups(
	iter func(id int, members []string),
)

type PortMatcher

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

func FromPorts

func FromPorts(
	ports node.Ports,
) *PortMatcher

func (*PortMatcher) Match

func (pm *PortMatcher) Match(other *PortMatcher) (rv float64)

func (*PortMatcher) Merge

func (pm *PortMatcher) Merge(other *PortMatcher)

type Rules

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

func NewRules

func NewRules(
	b graph.NamedBuilderWriter,
	r exprRUN,
) *Rules

func (*Rules) AddEdge

func (cb *Rules) AddEdge(src, dst string, port *node.Port)

func (*Rules) AddNode

func (cb *Rules) AddNode(n *node.Node) error

func (*Rules) CountRules

func (cb *Rules) CountRules() int

func (*Rules) FromReader

func (cb *Rules) FromReader(r io.Reader) (err error)

func (*Rules) Match

func (cb *Rules) Match(n *node.Node) (cluster string, ok bool)

func (*Rules) Name

func (cb *Rules) Name() string

func (*Rules) Write

func (cb *Rules) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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