...

Package graph

import "github.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon/graph"
Overview
Index

Overview ▾

type Edge

Edge represents an edge in graph

type Edge struct {
    Source uint32
    Target uint32
    Next   *Edge
}

type Graph

Graph represents a graph with link list

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

func NewGraph

func NewGraph() *Graph

NewGraph creates a Graph

func (*Graph) Flatten

func (g *Graph) Flatten(source uint32, log logr.Logger) []uint32

Flatten flattens the subtree from source (without checking whether it's a tree)

func (*Graph) Insert

func (g *Graph) Insert(source uint32, target uint32)

Insert inserts an Edge into a graph from source to target

func (*Graph) IterFrom

func (g *Graph) IterFrom(source uint32) *Edge

IterFrom starts iterating from source node