Version: v0.6.0 Latest Latest

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

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




This section is empty.


This section is empty.


This section is empty.


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 {

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

EdgeData is the struct plus our additional fields.

type EdgeWrapper

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

EdgeWrapper is the struct.

type Elements

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

Elements is the 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 {

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

NodeData is the struct plus our additional fields.

type NodeWrapper

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

NodeWrapper is the 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