Documentation ¶
Overview ¶
Package events provides events status for a namespace.
Index ¶
Constants ¶
const ( EventNormal = corev1.EventTypeNormal EventWarning = corev1.EventTypeWarning )
Values for EventType. These constants are copied from k8s.io/api/core/v1 as a convenience.
Variables ¶
This section is empty.
Functions ¶
func WatchEventStatus ¶
func WatchEventStatus(ctx context.Context, client kubernetes.Interface, namespace string) (chan *EventStatus, func(), error)
WatchEventStatus returns a channel on which the status of the events in the supplied namespace are written.
Types ¶
type EventStatus ¶
type EventStatus struct { Name string // name of event UID types.UID Namespace string Message string Type string Event corev1.Event // copy of the raw event }
A EventStatus represents the status of a single Event.
func EventToStatus ¶
func EventToStatus(event *corev1.Event) *EventStatus
EventToStatus returns a pointer to a new EventStatus for an event.
func GetEventStatus ¶
func GetEventStatus(ctx context.Context, client kubernetes.Interface, namespace string) ([]*EventStatus, error)
GetEventStatus returns the status of the events found in the supplied namespace.
func (*EventStatus) Equal ¶
func (e *EventStatus) Equal(q *EventStatus) bool
func (*EventStatus) String ¶
func (e *EventStatus) String() string
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
A Watcher watches event updates.
func NewWatcher ¶
NewWatcher returns a Watcher on the provided client or an error. The cancel function is called when the Watcher determines an event has permanently failed. The Watcher will exit if the context provided is canceled, an error is encountered, or Cleanup is called.
func (*Watcher) Cleanup ¶
Cleanup should be called when the Watcher is no longer needed. If the Watcher encountered an error the provided err is logged and the Watcher error is returned, otherwise err is returned.
func (*Watcher) SetProgress ¶
SetProgress determins if progress output should be displayed while watching.