Documentation
¶
Index ¶
- Constants
- func Debounce[T any](ch <-chan T, interval time.Duration) <-chan T
- func TagName(kind ResourceKind) string
- type InformerGrapher
- func (g *InformerGrapher) Graph(ctx context.Context) (platform.Graph, error)
- func (g *InformerGrapher) Graphs() <-chan platform.Graph
- func (g *InformerGrapher) OnAdd(object any, isInitialList bool)
- func (g *InformerGrapher) OnDelete(object any)
- func (g *InformerGrapher) OnUpdate(oldObject any, newObject any)
- func (g *InformerGrapher) Start()
- func (g *InformerGrapher) Stop()
- type Options
- type Platform
- type Resource
- type ResourceKind
Constants ¶
const ( ResourceKindAppsV1Deployment = "apps/v1/deployment" ResourceKindAppsV1DaemonSet = "apps/v1/daemonset" ResourceKindAppsV1ReplicaSet = "apps/v1/replicaset" ResourceKindAppsV1StatefulSet = "apps/v1/statefulset" ResourceKindBatchV1CronJob = "batch/v1/cronjob" ResourceKindBatchV1Job = "batch/v1/job" ResourceKindCoreV1Node = "core/v1/node" ResourceKindCoreV1Namespace = "core/v1/namespace" ResourceKindCoreV1Pod = "core/v1/pod" ResourceKindCoreV1Container = "core/v1/container" ResourceKindUnknown = "unknown" )
Variables ¶
This section is empty.
Functions ¶
func Debounce ¶ added in v0.21.0
Debounce debounces messages sent to ch, returning at most one message per interval. The latest message sent to ch during a debounced time window, if any, will be sent the next window.
func TagName ¶
func TagName(kind ResourceKind) string
TagName returns the human-readable name of a tag representing the resource. Panics if ResourceKind.IsSupported returns false.
Types ¶
type InformerGrapher ¶
type InformerGrapher struct {
// contains filtered or unexported fields
}
InformerGrapher is a Kubernetes "informer" that reacts on changes made to resources, graphing them continuously.
func NewInformerGrapher ¶
func NewInformerGrapher(clientset *kubernetes.Clientset, includeOldReplicaSets bool, debounceInterval time.Duration) (*InformerGrapher, error)
NewInformerGrapher returns a new InformerGrapher.
- includeOldReplicaSets can be set to true to include all replica sets, no matter their age
func (*InformerGrapher) Graphs ¶
func (g *InformerGrapher) Graphs() <-chan platform.Graph
Graphs returns a channel which will receive all graphs produced by the grapher asynchronously. The returned channel is shared among all consumers.
func (*InformerGrapher) OnAdd ¶
func (g *InformerGrapher) OnAdd(object any, isInitialList bool)
OnAdd implements cache.ResourceEventHandler.
func (*InformerGrapher) OnDelete ¶
func (g *InformerGrapher) OnDelete(object any)
OnDelete implements cache.ResourceEventHandler.
func (*InformerGrapher) OnUpdate ¶
func (g *InformerGrapher) OnUpdate(oldObject any, newObject any)
OnUpdate implements cache.ResourceEventHandler.
func (*InformerGrapher) Stop ¶
func (g *InformerGrapher) Stop()
Stop stops the grapher and cleans up resources. A stopped grapher cannot be started again.
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform implements graphing for the Kubernetes platform.
func NewPlatform ¶
NewPlatform initializes a new Platform.
- config hold information about how to connect to the Kubernetes APIs.
type Resource ¶
type Resource interface { platform.Node // Kind returns the type of resource. Kind() ResourceKind // Name returns the name of the resource. Name() string // String returns a textual representation of the resource. String() string }
Resource is a Kubernetes resource found on the platform.
type ResourceKind ¶
type ResourceKind string
ResourceKind defines the types of resources exposed by the platform.
func (ResourceKind) IsSupported ¶ added in v0.15.0
func (r ResourceKind) IsSupported() bool
IsSupported returns whether or not the resource is supported. Filters out custom resource definitions.