cytoscape

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Cytoscape package provides conversion from our graph to the CystoscapeJS configuration json model.

The following links are useful for understanding CytoscapeJS and it's configuration:

Main page: http://js.cytoscape.org/ JSON config: http://js.cytoscape.org/#notation/elements-json Demos: http://js.cytoscape.org/#demos

Algorithm: Process the graph structure adding nodes and edges, decorating each

with information provided.  An optional second pass generates compound
nodes for version grouping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Timestamp int64    `json:"timestamp"`
	Duration  int64    `json:"duration"`
	GraphType string   `json:"graphType"`
	Elements  Elements `json:"elements"`
}

func NewConfig

func NewConfig(trafficMap graph.TrafficMap, o options.VendorOptions) (result Config)

type EdgeData

type EdgeData struct {
	// Cytoscape Fields
	Id     string `json:"id"`     // unique internal edge ID (e0, e1...)
	Source string `json:"source"` // parent node ID
	Target string `json:"target"` // child node ID

	// App Fields (not required by Cytoscape)
	Traffic      ProtocolTraffic `json:"traffic,omitempty"`      // traffic rates for the edge protocol
	ResponseTime string          `json:"responseTime,omitempty"` // in millis
	IsMTLS       string          `json:"isMTLS,omitempty"`       // set to the percentage of traffic using a mutual TLS connection
	IsUnused     bool            `json:"isUnused,omitempty"`     // true | false
}

type EdgeWrapper

type EdgeWrapper struct {
	Data *EdgeData `json:"data"`
}

type Elements

type Elements struct {
	Nodes []*NodeWrapper `json:"nodes"`
	Edges []*EdgeWrapper `json:"edges"`
}

type NodeData

type NodeData struct {
	// Cytoscape Fields
	Id     string `json:"id"`               // unique internal node ID (n0, n1...)
	Parent string `json:"parent,omitempty"` // Compound Node parent ID

	// App Fields (not required by Cytoscape)
	NodeType        string            `json:"nodeType"`
	Namespace       string            `json:"namespace"`
	Workload        string            `json:"workload,omitempty"`
	App             string            `json:"app,omitempty"`
	Version         string            `json:"version,omitempty"`
	Service         string            `json:"service,omitempty"`         // requested service for NodeTypeService
	DestServices    map[string]bool   `json:"destServices,omitempty"`    // requested services for [dest] node
	Traffic         []ProtocolTraffic `json:"traffic,omitempty"`         // traffic rates for all detected protocols
	HasCB           bool              `json:"hasCB,omitempty"`           // true (has circuit breaker) | false
	HasMissingSC    bool              `json:"hasMissingSC,omitempty"`    // true (has missing sidecar) | false
	HasVS           bool              `json:"hasVS,omitempty"`           // true (has route rule) | false
	IsDead          bool              `json:"isDead,omitempty"`          // true (has no pods) | false
	IsGroup         string            `json:"isGroup,omitempty"`         // set to the grouping type, current values: [ 'app', 'version' ]
	IsInaccessible  bool              `json:"isInaccessible,omitempty"`  // true if the node exists in an inaccessible namespace
	IsMisconfigured string            `json:"isMisconfigured,omitempty"` // set to misconfiguration list, current values: [ 'labels' ]
	IsOutside       bool              `json:"isOutside,omitempty"`       // true | false
	IsRoot          bool              `json:"isRoot,omitempty"`          // true | false
	IsServiceEntry  string            `json:"isServiceEntry,omitempty"`  // set to the location, current values: [ 'MESH_EXTERNAL', 'MESH_INTERNAL' ]
	IsUnused        bool              `json:"isUnused,omitempty"`        // true | false
}

type NodeWrapper

type NodeWrapper struct {
	Data *NodeData `json:"data"`
}

type ProtocolTraffic added in v0.14.0

type ProtocolTraffic struct {
	Protocol string            `json:"protocol"` // protocol
	Rates    map[string]string `json:"rates"`    // map[rate]value
}

Jump to

Keyboard shortcuts

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