Documentation ¶
Index ¶
- type Config
- type EdgeData
- type EdgeWrapper
- type Elements
- type Graph
- type Instance
- type MockInstance
- func (_m *MockInstance) GetGraph(ctx context.Context, duration int64, graphType string, groupBy string, ...) (*Graph, error)
- func (_m *MockInstance) GetMetrics(ctx context.Context, url string) (*map[string]interface{}, error)
- func (_m *MockInstance) GetName() string
- func (_m *MockInstance) GetNamespaces(ctx context.Context) ([]models.Namespace, error)
- type NewMockInstanceT
- type NodeData
- type NodeWrapper
- type ResponseError
- type Traffic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Address string `json:"address"` Username string `json:"username"` Password string `json:"password"` Token string `json:"token"` }
Config is the structure of the configuration for a single Harbor database 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 interface { GetName() string GetNamespaces(ctx context.Context) ([]models.Namespace, error) GetGraph(ctx context.Context, duration int64, graphType, groupBy string, injectServiceNodes bool, appenders, namespaces []string) (*Graph, error) GetMetrics(ctx context.Context, url string) (*map[string]any, error) }
type MockInstance ¶
MockInstance is an autogenerated mock type for the Instance type
func NewMockInstance ¶
func NewMockInstance(t NewMockInstanceT) *MockInstance
NewMockInstance creates a new instance of MockInstance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInstance) GetGraph ¶
func (_m *MockInstance) GetGraph(ctx context.Context, duration int64, graphType string, groupBy string, injectServiceNodes bool, appenders []string, namespaces []string) (*Graph, error)
GetGraph provides a mock function with given fields: ctx, duration, graphType, groupBy, injectServiceNodes, appenders, namespaces
func (*MockInstance) GetMetrics ¶
func (_m *MockInstance) GetMetrics(ctx context.Context, url string) (*map[string]interface{}, error)
GetMetrics provides a mock function with given fields: ctx, url
func (*MockInstance) GetName ¶
func (_m *MockInstance) GetName() string
GetName provides a mock function with given fields:
func (*MockInstance) GetNamespaces ¶
GetNamespaces provides a mock function with given fields: ctx
type NewMockInstanceT ¶
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 { Errors []struct { Code string `json:"code"` Message string `json:"message"` } `json:"errors"` }
ResponseError is the structure for a failed Harbor API request.