interruptionevent

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ScheduledEventKind is a const to define a scheduled event kind of interruption event
	ScheduledEventKind = "SCHEDULED_EVENT"
)
View Source
const (
	// SpotITNKind is a const to define a Spot ITN kind of interruption event
	SpotITNKind = "SPOT_ITN"
)

Variables

This section is empty.

Functions

func MonitorForScheduledEvents

func MonitorForScheduledEvents(interruptionChan chan<- InterruptionEvent, cancelChan chan<- InterruptionEvent, imds *ec2metadata.Service) error

MonitorForScheduledEvents continuously monitors metadata for scheduled events and sends interruption events to the passed in channel

func MonitorForSpotITNEvents

func MonitorForSpotITNEvents(interruptionChan chan<- InterruptionEvent, cancelChan chan<- InterruptionEvent, imds *ec2metadata.Service) error

MonitorForSpotITNEvents continuously monitors metadata for spot ITNs and sends interruption events to the passed in channel

Types

type InterruptionEvent

type InterruptionEvent struct {
	EventID      string
	Kind         string
	Description  string
	State        string
	StartTime    time.Time
	EndTime      time.Time
	Drained      bool
	PreDrainTask preDrainTask `json:"-"`
}

InterruptionEvent gives more context of the interruption event

func (*InterruptionEvent) TimeUntilEvent

func (e *InterruptionEvent) TimeUntilEvent() time.Duration

TimeUntilEvent returns the duration until the event start time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL