instance

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string  `json:"name"`
	DisplayName string  `json:"displayName"`
	Description string  `json:"description"`
	Address     string  `json:"address"`
	Username    string  `json:"username"`
	Password    string  `json:"password"`
	Token       string  `json:"token"`
	Traffic     Traffic `json:"traffic"`
}

Config is the structure of the configuration for a single Kiali instance.

type EdgeData

type EdgeData struct {
	cytoscape.EdgeData

	EdgeType  string `json:"edgeType"`
	EdgeLabel string `json:"edgeLabel"`
}

EdgeData is the https://pkg.go.dev/github.com/kiali/kiali@v1.37.0/graph/config/cytoscape#EdgeData struct plus our additional fields.

type EdgeWrapper

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

EdgeWrapper is the https://pkg.go.dev/github.com/kiali/kiali@v1.37.0/graph/config/cytoscape#EdgeWrapper struct.

type Elements

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

Elements is the https://pkg.go.dev/github.com/kiali/kiali@v1.37.0/graph/config/cytoscape#Elements struct.

type Graph

type Graph struct {
	Elements *Elements `json:"elements"`
}

Graph is the structure of the returned topology graph from Kiali. We have to implement it by ourselve, because we have to add some additional fields, which are required by the React UI.

type Instance

type Instance struct {
	Name string
	// contains filtered or unexported fields
}

Instance represents a single Kiali instance, which can be added via the configuration file.

func New

func New(config Config) (*Instance, error)

New returns a new Kiali instance for the given configuration.

func (*Instance) GetGraph

func (i *Instance) GetGraph(ctx context.Context, duration int64, graphType, groupBy string, injectServiceNodes bool, appenders, namespaces []string) (*Graph, error)

GetGraph returns the topology graph from the Kiali API, with some additional fields, which we need to render the graph in our React UI.

func (*Instance) GetMetrics

func (i *Instance) GetMetrics(ctx context.Context, url string) (*map[string]interface{}, error)

GetMetrics returns the metrics for an edge or node in the Kiali topology graph.

func (*Instance) GetNamespaces

func (i *Instance) GetNamespaces(ctx context.Context) ([]models.Namespace, error)

GetNamespaces returns all namespaces from the Kiali instance.

type NodeData

type NodeData struct {
	cytoscape.NodeData

	NodeLabel     string `json:"nodeLabel"`
	NodeLabelFull string `json:"nodeLabelFull"`
	NodeImage     string `json:"nodeImage"`
}

NodeData is the https://pkg.go.dev/github.com/kiali/kiali@v1.37.0/graph/config/cytoscape#NodeData struct plus our additional fields.

type NodeWrapper

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

NodeWrapper is the https://pkg.go.dev/github.com/kiali/kiali@v1.37.0/graph/config/cytoscape#NodeWrapper struct.

type ResponseError

type ResponseError struct {
	Error string `json:"error"`
}

ResponseError is the structure for a failed Kiali API request.

type Traffic

type Traffic struct {
	Degraded float64 `json:"degraded"`
	Failure  float64 `json:"failure"`
}

Traffic is the traffic configuration, to set the value to mark a edge as degraded and failure.

Jump to

Keyboard shortcuts

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