Documentation ¶
Overview ¶
Package visualization implements Aptomi policy & resolution data visualization using network-based diagrams for visjs
Index ¶
- Variables
- type ClaimResolutionCfg
- type Graph
- type GraphBuilder
- func (b *GraphBuilder) ClaimResolution(cfg *ClaimResolutionCfg) *Graph
- func (b *GraphBuilder) ClaimResolutionWithFunc(cfg *ClaimResolutionCfg, exists func(*resolve.ComponentInstance) bool) *Graph
- func (b *GraphBuilder) Object(obj runtime.Object) *Graph
- func (b *GraphBuilder) Policy(cfg *PolicyCfg) *Graph
- type PolicyCfg
Constants ¶
This section is empty.
Variables ¶
var ClaimResolutionCfgDefault = &ClaimResolutionCfg{ showTrivialServices: true, showServices: false, }
ClaimResolutionCfgDefault is default graph generation parameters for ClaimResolution
var PolicyCfgDefault = &PolicyCfg{ showBundleComponentsOnlyForTopLevel: true, showBundleComponents: true, }
PolicyCfgDefault is default graph generation parameters for Policy
Functions ¶
This section is empty.
Types ¶
type ClaimResolutionCfg ¶ added in v0.1.15
type ClaimResolutionCfg struct {
// contains filtered or unexported fields
}
ClaimResolutionCfg defines graph generation parameters for ClaimResolution
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph is a data structure for visualizing Aptomi objects in a form of a graph with nodes and edges. It gets created by GraphBuilder. Once created, use GetDataJSON() to get the result and feed into vis.js.
func (*Graph) CalcDelta ¶
CalcDelta takes the current graph and modifies it to contain the difference between this graph and the baseline graph
func (*Graph) GetData ¶
func (g *Graph) GetData() interface{}
GetData returns a struct, which can be fed directly into vis.js as network map
func (*Graph) GetDataJSON ¶
GetDataJSON returns a JSON-formatted byte array, which can be fed directly into vis.js as network map
type GraphBuilder ¶
type GraphBuilder struct {
// contains filtered or unexported fields
}
GraphBuilder allows to visualize Aptomi policy and resolution data as a graph It can also render deltas between two visualizations, showing new and deleted objects between policies and resolution data.
func NewGraphBuilder ¶
func NewGraphBuilder(policy *lang.Policy, resolution *resolve.PolicyResolution, externalData *external.Data) *GraphBuilder
NewGraphBuilder returns a graph builder that visualizes policy and resolution data
func (*GraphBuilder) ClaimResolution ¶ added in v0.1.15
func (b *GraphBuilder) ClaimResolution(cfg *ClaimResolutionCfg) *Graph
ClaimResolution produces policy resolution graph by tracing every claim and displaying what got allocated
func (*GraphBuilder) ClaimResolutionWithFunc ¶ added in v0.1.15
func (b *GraphBuilder) ClaimResolutionWithFunc(cfg *ClaimResolutionCfg, exists func(*resolve.ComponentInstance) bool) *Graph
ClaimResolutionWithFunc produces policy resolution graph by tracing every claim and displaying what got allocated, which checking that instances exist (e.g. in actual state)
func (*GraphBuilder) Object ¶ added in v0.1.12
func (b *GraphBuilder) Object(obj runtime.Object) *Graph
Object produces a graph which represents an object
func (*GraphBuilder) Policy ¶
func (b *GraphBuilder) Policy(cfg *PolicyCfg) *Graph
Policy produces just a policy graph without showing any resolution data