drainevent

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 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 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

Jump to

Keyboard shortcuts

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