graph

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Graph package provides support for the graph handlers such as supported path variables and query params, as well as types for graph processing.

Index

Constants

View Source
const (
	GraphTypeApp          string = "app"
	GraphTypeVersionedApp string = "versionedApp"
	GraphTypeWorkload     string = "workload"
	NodeTypeApp           string = "app"
	NodeTypeService       string = "service"
	NodeTypeUnknown       string = "unknown" // The special "unknown" traffic gen node
	NodeTypeWorkload      string = "workload"
	TF                    string = "2006-01-02 15:04:05" // TF is the TimeFormat for timestamps
	UnknownApp            string = "unknown"
	UnknownNamespace      string = "unknown"
	UnknownVersion        string = "unknown"
	UnknownWorkload       string = "unknown"
)

Variables

This section is empty.

Functions

func Id

func Id(namespace, workload, app, version, service, graphType string) (id, nodeType string)

Types

type Edge

type Edge struct {
	Source   *Node
	Dest     *Node
	Metadata map[string]interface{} // app-specific data
}

func NewEdge

func NewEdge(source, dest *Node) Edge

type Node added in v0.6.0

type Node struct {
	ID        string                 // unique identifier for the node
	NodeType  string                 // Node type
	Namespace string                 // Namespace
	Workload  string                 // Workload (deployment) name
	App       string                 // Workload app label value
	Version   string                 // Workload version label value
	Service   string                 // Service name
	Edges     []*Edge                // child nodes
	Metadata  map[string]interface{} // app-specific data
}

func NewNode added in v0.6.0

func NewNode(namespace, workload, app, version, service, graphType string) Node

func NewNodeExplicit added in v0.6.0

func NewNodeExplicit(id, namespace, workload, app, version, service, nodeType, graphType string) Node

func (*Node) AddEdge added in v0.6.0

func (s *Node) AddEdge(dest *Node) *Edge

type TrafficMap

type TrafficMap map[string]*Node

TrafficMap is a map of app Nodes, each optionally holding Edge data. Metadata is a general purpose map for holding any desired node or edge information. Each app node should have a unique namespace+workload. Note that it is feasible but likely unusual to have two nodes with the same name+version in the same namespace.

func NewTrafficMap

func NewTrafficMap() TrafficMap

Directories

Path Synopsis
Cytoscape package provides conversion from our graph to the CystoscapeJS configuration json model.
Cytoscape package provides conversion from our graph to the CystoscapeJS configuration json model.
Options package holds the option settings for a single graph generation.
Options package holds the option settings for a single graph generation.
THIS CODE IS PROVIDED AS-IS and the resulting config JSON is targeted for standalone Vizceral use.
THIS CODE IS PROVIDED AS-IS and the resulting config JSON is targeted for standalone Vizceral use.

Jump to

Keyboard shortcuts

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