Documentation
¶
Index ¶
- Constants
- func IsLogging(r types.Resource) bool
- func RegisterResourceRenderer(k string, r ResourceRenderer)
- func ToggleLogs(r types.Resource, containerName string)
- type ContainerInfo
- type Copyable
- type DAO
- type K8sResource
- type K8sWatcher
- func (w *K8sWatcher) Add(r Resource)
- func (w *K8sWatcher) ChangedSince(t time.Time) bool
- func (w *K8sWatcher) Delete(r Resource)
- func (w *K8sWatcher) OnChange(onChange func())
- func (w *K8sWatcher) StartWatching(ctx context.Context, client conn.KhronosConn, dao DAO, lc *LogCollector, ...) error
- func (w *K8sWatcher) Update(r Resource)
- type LogCollector
- type NodeExtra
- type Pod
- type PodExtra
- type PodMetric
- type PodRenderer
- type Resource
- func (r Resource) GetDetails() []string
- func (r Resource) GetExtra() any
- func (r Resource) GetKind() string
- func (r Resource) GetName() string
- func (r Resource) GetNamespace() string
- func (r Resource) GetTimestamp() time.Time
- func (r Resource) GetUID() string
- func (r Resource) Key() string
- func (r Resource) String() string
- type ResourceEventWatcher
- type ResourceRenderer
Constants ¶
View Source
const WATCHER_STEP = time.Second * 1
Variables ¶
This section is empty.
Functions ¶
func RegisterResourceRenderer ¶
func RegisterResourceRenderer(k string, r ResourceRenderer)
func ToggleLogs ¶
Types ¶
type ContainerInfo ¶
type K8sResource ¶
type K8sWatcher ¶
type K8sWatcher struct {
// contains filtered or unexported fields
}
Watches for a variety of k8s resources state changes and tracks their values over time
func GetK8sWatcher ¶
func GetK8sWatcher(data DAO) *K8sWatcher
func (*K8sWatcher) ChangedSince ¶
func (w *K8sWatcher) ChangedSince(t time.Time) bool
See if anything we watch has changed since a certain time
func (*K8sWatcher) Delete ¶
func (w *K8sWatcher) Delete(r Resource)
Delete a resource in the temporal map
func (*K8sWatcher) OnChange ¶
func (w *K8sWatcher) OnChange(onChange func())
Set the onChange callback
func (*K8sWatcher) StartWatching ¶
func (w *K8sWatcher) StartWatching(ctx context.Context, client conn.KhronosConn, dao DAO, lc *LogCollector, ns string) error
func (*K8sWatcher) Update ¶
func (w *K8sWatcher) Update(r Resource)
Update a resource in the temporal map
type LogCollector ¶
type LogCollector struct {
// contains filtered or unexported fields
}
func GetLogCollector ¶
func GetLogCollector(client conn.KhronosConn) *LogCollector
type NodeExtra ¶
type Pod ¶
type Pod struct {
Spec struct {
Containers []struct {
Image string `json:"image"`
Name string `json:"name"`
Resources struct {
Limits struct {
CPU string `json:"cpu"`
Memory string `json:"memory"`
} `json:"limits"`
} `json:"resources"`
} `json:"containers"`
NodeName string `json:"nodeName"`
} `json:"spec"`
Status struct {
Phase string `json:"phase"`
} `json:"status"`
}
type PodExtra ¶
type PodRenderer ¶
type PodRenderer struct {
// contains filtered or unexported fields
}
type Resource ¶
type Resource struct {
Uid string // The Uid of the k8s object
Timestamp serializable.Time // The timestamp that this resource is valid for
Kind string // The k8s kind of resource
Namespace string // The k8s namespace, may be empty for things like namespace and node resources
Name string // The name of the resource
RawJSON string // Raw json for this k8s resource
Extra Copyable // This should be a custom, gob registered and serializable object if used
}
func NewK8sResource ¶
func NewK8sResource(kind string, obj K8sResource, extra Copyable) Resource
func NewResource ¶
func (Resource) GetDetails ¶
Render the details of the Resource
func (Resource) GetNamespace ¶
func (Resource) GetTimestamp ¶
type ResourceEventWatcher ¶
type ResourceEventWatcher interface {
ToResource(obj runtime.Object) Resource // Converts a kubernetes object to a Resource
Tick() // Called at a regular interval and can be used to do any needed work to update Resources not handled by Add/Modified/Del like metrics & logs
Renderer() ResourceRenderer
Kind() string
}
Interface for watching resource events.
type ResourceRenderer ¶
func GetRenderer ¶
func GetRenderer(k string) ResourceRenderer
Click to show internal directories.
Click to hide internal directories.