cytoscape

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: 6 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"`
	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)
	Rate         string `json:"rate,omitempty"`
	Rate3xx      string `json:"rate3XX,omitempty"`
	Rate4xx      string `json:"rate4XX,omitempty"`
	Rate5xx      string `json:"rate5XX,omitempty"`
	PercentErr   string `json:"percentErr,omitempty"`
	PercentRate  string `json:"percentRate,omitempty"` // percent of total parent requests
	ResponseTime string `json:"responseTime,omitempty"`
	IsMTLS       bool   `json:"isMTLS,omitempty"`   // true (mutual TLS connection) | false
	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
	Rate            string          `json:"rate,omitempty"`            // edge aggregate
	Rate3xx         string          `json:"rate3XX,omitempty"`         // edge aggregate
	Rate4xx         string          `json:"rate4XX,omitempty"`         // edge aggregate
	Rate5xx         string          `json:"rate5XX,omitempty"`         // edge aggregate
	RateOut         string          `json:"rateOut,omitempty"`         // edge aggregate
	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: [ 'version' ]
	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
	IsUnused        bool            `json:"isUnused,omitempty"`        // true | false
}

type NodeWrapper

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

Jump to

Keyboard shortcuts

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