Documentation
¶
Index ¶
- Constants
- Variables
- func ExpandSubgraph(ctx context.Context, backend ontology.Backend, options ExpandOptions) (api.GraphSubgraph, error)
- func ParseTerminalNodeKinds(raw string) ([]api.NodeKind, bool, error)
- func ValidateDiagnosticOptions(options DiagnosticOptions) error
- func ValidateExpandOptions(options ExpandOptions) error
- type DiagnosticOptions
- type DiagnosticSubgraphResponse
- type ErrorResponse
- type ExpandOptions
- type Facade
- func (f *Facade) DiagnosticPolicy(options DiagnosticOptions) api.ExpansionPolicy
- func (f *Facade) FindEntryID(entryKind, namespace, name string) (string, error)
- func (f *Facade) QueryDiagnosticSubgraph(entryKind, namespace, name string, options DiagnosticOptions) (api.DiagnosticSubgraph, error)
- func (f *Facade) QueryDiagnosticSubgraphContext(ctx context.Context, entryKind, namespace, name string, ...) (api.DiagnosticSubgraph, error)
- func (f *Facade) RuntimeStatus() RuntimeStatus
- func (f *Facade) SetRuntimeStatus(status RuntimeStatus)
- func (f *Facade) SetSnapshot(snapshot collectk8s.Snapshot)
- type Freshness
- type GraphExpansion
- type GraphStateDocument
- type GraphStateGraph
- type GraphSubgraphResponse
- type RuntimeStatus
Constants ¶
View Source
const ( DefaultExpandDepth = 1 MaxExpandDepth = 4 DefaultExpandLimit = 200 MaxExpandLimit = 2000 )
View Source
const MaxDiagnosticDepth = 10
Variables ¶
Functions ¶
func ExpandSubgraph ¶
func ExpandSubgraph(ctx context.Context, backend ontology.Backend, options ExpandOptions) (api.GraphSubgraph, error)
func ValidateDiagnosticOptions ¶
func ValidateDiagnosticOptions(options DiagnosticOptions) error
func ValidateExpandOptions ¶
func ValidateExpandOptions(options ExpandOptions) error
Types ¶
type DiagnosticOptions ¶
type DiagnosticSubgraphResponse ¶
type DiagnosticSubgraphResponse struct {
api.DiagnosticSubgraph
NodeCount int `json:"nodeCount"`
EdgeCount int `json:"edgeCount"`
Freshness Freshness `json:"freshness"`
}
func NewDiagnosticSubgraphResponse ¶
func NewDiagnosticSubgraphResponse(result api.DiagnosticSubgraph, status RuntimeStatus) DiagnosticSubgraphResponse
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
Code string `json:"code"`
Status int `json:"status,omitempty"`
Retryable bool `json:"retryable"`
Source string `json:"source,omitempty"`
}
func NewErrorResponse ¶
func NewErrorResponse(code string, status int, err error, retryable bool) ErrorResponse
type ExpandOptions ¶
type Facade ¶
type Facade struct {
Diagnostic *diagnostic.Service
// contains filtered or unexported fields
}
func NewFacade ¶
func NewFacade(cluster string, snapshot collectk8s.Snapshot, builder *graph.Builder, diagnosticService *diagnostic.Service) *Facade
func (*Facade) DiagnosticPolicy ¶
func (f *Facade) DiagnosticPolicy(options DiagnosticOptions) api.ExpansionPolicy
func (*Facade) FindEntryID ¶
func (*Facade) QueryDiagnosticSubgraph ¶
func (f *Facade) QueryDiagnosticSubgraph(entryKind, namespace, name string, options DiagnosticOptions) (api.DiagnosticSubgraph, error)
func (*Facade) QueryDiagnosticSubgraphContext ¶
func (f *Facade) QueryDiagnosticSubgraphContext(ctx context.Context, entryKind, namespace, name string, options DiagnosticOptions) (api.DiagnosticSubgraph, error)
func (*Facade) RuntimeStatus ¶
func (f *Facade) RuntimeStatus() RuntimeStatus
func (*Facade) SetRuntimeStatus ¶
func (f *Facade) SetRuntimeStatus(status RuntimeStatus)
func (*Facade) SetSnapshot ¶
func (f *Facade) SetSnapshot(snapshot collectk8s.Snapshot)
type Freshness ¶
type Freshness struct {
Ready bool `json:"ready"`
Phase string `json:"phase,omitempty"`
Cluster string `json:"cluster,omitempty"`
NodeCount int `json:"nodeCount"`
EdgeCount int `json:"edgeCount"`
LastRefreshAt string `json:"lastRefreshAt,omitempty"`
LastBootstrapAt string `json:"lastBootstrapAt,omitempty"`
LastAppliedChangeKind string `json:"lastAppliedChangeKind,omitempty"`
LastAppliedChangeNamespace string `json:"lastAppliedChangeNamespace,omitempty"`
LastAppliedChangeName string `json:"lastAppliedChangeName,omitempty"`
LastAppliedChangeType string `json:"lastAppliedChangeType,omitempty"`
LastAppliedChangeAt string `json:"lastAppliedChangeAt,omitempty"`
LastStrategy string `json:"lastStrategy,omitempty"`
LastError string `json:"lastError,omitempty"`
}
func FreshnessFromRuntimeStatus ¶
func FreshnessFromRuntimeStatus(status RuntimeStatus) Freshness
type GraphExpansion ¶
type GraphExpansion struct {
GraphStateGraph
ExpandedFrom string `json:"expandedFrom"`
Depth int `json:"depth,omitempty"`
Direction string `json:"direction,omitempty"`
Limit int `json:"limit,omitempty"`
}
type GraphStateDocument ¶
type GraphStateDocument struct {
Source string `json:"source,omitempty"`
Mode string `json:"mode,omitempty"`
Status json.RawMessage `json:"status,omitempty"`
Entry json.RawMessage `json:"entry,omitempty"`
Nodes []api.DiagnosticNode `json:"nodes,omitempty"`
Edges []api.DiagnosticEdge `json:"edges,omitempty"`
CollectedAt json.RawMessage `json:"collectedAt,omitempty"`
Explanation []string `json:"explanation,omitempty"`
BaseGraph *GraphStateGraph `json:"baseGraph,omitempty"`
Expansions []GraphExpansion `json:"expansions,omitempty"`
ExportedAt string `json:"exportedAt,omitempty"`
}
func CollapseGraphExpansion ¶
func CollapseGraphExpansion(doc GraphStateDocument, entityID string) (GraphStateDocument, error)
type GraphStateGraph ¶
type GraphStateGraph struct {
Source string `json:"source,omitempty"`
Mode string `json:"mode,omitempty"`
Status json.RawMessage `json:"status,omitempty"`
Entry json.RawMessage `json:"entry,omitempty"`
Nodes []api.DiagnosticNode `json:"nodes,omitempty"`
Edges []api.DiagnosticEdge `json:"edges,omitempty"`
CollectedAt json.RawMessage `json:"collectedAt,omitempty"`
Explanation []string `json:"explanation,omitempty"`
}
type GraphSubgraphResponse ¶
type GraphSubgraphResponse struct {
api.GraphSubgraph
NodeCount int `json:"nodeCount"`
EdgeCount int `json:"edgeCount"`
Freshness Freshness `json:"freshness"`
}
func NewGraphSubgraphResponse ¶
func NewGraphSubgraphResponse(result api.GraphSubgraph, status RuntimeStatus) GraphSubgraphResponse
type RuntimeStatus ¶
type RuntimeStatus struct {
Phase string
Cluster string
Ready bool
NodeCount int
EdgeCount int
LastBootstrapAt string
LastAppliedChangeKind string
LastAppliedChangeNS string
LastAppliedChangeName string
LastAppliedChangeType string
LastAppliedChangeAt string
LastStrategy string
FullRebuildCount int
EventNarrowCount int
StorageNarrowCount int
ServiceNarrowCount int
PodNarrowCount int
WorkloadNarrowCount int
IdentitySecurityNarrowCount int
LastError string
}
Click to show internal directories.
Click to hide internal directories.