Documentation
¶
Index ¶
Constants ¶
View Source
const (
// ScheduledEventKind is a const to define a scheduled event kind of drainable event
ScheduledEventKind = "SCHEDULED_EVENT"
)
View Source
const (
// SpotITNKind is a const to define a Spot ITN kind of drainable event
SpotITNKind = "SPOT_ITN"
)
Variables ¶
This section is empty.
Functions ¶
func MonitorForScheduledEvents ¶
func MonitorForScheduledEvents(drainChan chan<- DrainEvent, cancelChan chan<- DrainEvent, imds *ec2metadata.Service) error
MonitorForScheduledEvents continuously monitors metadata for scheduled events and sends drain events to the passed in channel
func MonitorForSpotITNEvents ¶
func MonitorForSpotITNEvents(drainChan chan<- DrainEvent, cancelChan chan<- DrainEvent, imds *ec2metadata.Service) error
MonitorForSpotITNEvents continuously monitors metadata for spot ITNs and sends drain events to the passed in channel
Types ¶
type DrainEvent ¶
type DrainEvent struct {
EventID string
Kind string
Description string
State string
StartTime time.Time
EndTime time.Time
Drained bool
PreDrainTask preDrainTask `json:"-"`
}
DrainEvent gives more context of the drainable event
func (*DrainEvent) TimeUntilEvent ¶
func (e *DrainEvent) TimeUntilEvent() time.Duration
TimeUntilEvent returns the duration until the event start time
Click to show internal directories.
Click to hide internal directories.