graph

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	ID       string `json:"id"`
	Src      string `json:"src"`
	Dst      string `json:"dst"`
	Sport    int    `json:"sport"`
	Dport    int    `json:"dport"`
	Protocol string `json:"protocol"`
	Bytes    int    `json:"bytes"`
	Packets  int    `json:"packets"`
}

type FlowGraph

type FlowGraph struct {
	Nodes map[string]*Node `json:"nodes"`
	Edges map[string]*Edge `json:"edges"`
}

func FromVector

func FromVector(m model.Vector, podInfo model.Vector, nodeInfo model.Vector) (*FlowGraph, error)

func NewFlowGraph

func NewFlowGraph() *FlowGraph

func (*FlowGraph) AddEdge

func (g *FlowGraph) AddEdge(e Edge)

func (*FlowGraph) AddNode

func (g *FlowGraph) AddNode(n Node)

func (*FlowGraph) SetEdgeBytesFromVector

func (g *FlowGraph) SetEdgeBytesFromVector(m model.Vector)

func (*FlowGraph) SetEdgePacketsFromVector

func (g *FlowGraph) SetEdgePacketsFromVector(m model.Vector)

func (*FlowGraph) ToJSON

func (g *FlowGraph) ToJSON() ([]byte, error)

type Node

type Node struct {
	ID        string `json:"id"`
	IP        string `json:"ip"`
	Type      string `json:"type"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	NodeName  string `json:"node_name"`
}

Jump to

Keyboard shortcuts

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