Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoscalingClient ¶
type AutoscalingClient autoscalingiface.AutoScalingAPI
AutoscalingClient for testing purposes
type AutoscalingListener ¶
type AutoscalingListener struct {
// contains filtered or unexported fields
}
AutoscalingListener ...
func NewAutoscalingListener ¶
func NewAutoscalingListener(instanceID string, queue *Queue, autoscaling AutoscalingClient) *AutoscalingListener
NewAutoscalingListener ...
func (*AutoscalingListener) Start ¶
func (l *AutoscalingListener) Start(ctx context.Context, notices chan<- TerminationNotice, log *logrus.Entry) error
Start the autoscaling lifecycle hook listener.
func (*AutoscalingListener) Type ¶
func (l *AutoscalingListener) Type() string
Type returns a string describing the listener type.
type Config ¶
type Config struct { InstanceID string SNSTopic string SpotListener bool SpotListenerInterval time.Duration }
Config for the Lifecycled Daemon.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is what orchestrates the listening and execution of the handler on a termination notice.
func NewDaemon ¶
func NewDaemon( config *Config, sqsClient SQSClient, snsClient SNSClient, asgClient AutoscalingClient, metadata *ec2metadata.EC2Metadata, logger *logrus.Logger, ) *Daemon
NewDaemon creates a new Daemon.
type Envelope ¶
type Envelope struct { Type string `json:"Type"` Subject string `json:"Subject"` Time time.Time `json:"Time"` Message string `json:"Message"` }
Envelope ...
type FileHandler ¶
type FileHandler struct {
// contains filtered or unexported fields
}
FileHandler ...
type Listener ¶
type Listener interface { Type() string Start(context.Context, chan<- TerminationNotice, *logrus.Entry) error }
Listener ...
type Message ¶
type Message struct { Time time.Time `json:"Time"` GroupName string `json:"AutoScalingGroupName"` InstanceID string `json:"EC2InstanceId"` ActionToken string `json:"LifecycleActionToken"` Transition string `json:"LifecycleTransition"` HookName string `json:"LifecycleHookName"` }
Message ...
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue manages the SQS queue and SNS subscription.
func (*Queue) DeleteMessage ¶
DeleteMessage from the queue.
func (*Queue) GetMessages ¶
GetMessages long polls for messages from the SQS queue.
func (*Queue) Unsubscribe ¶
Unsubscribe the queue from the SNS topic.
type SpotListener ¶
type SpotListener struct {
// contains filtered or unexported fields
}
SpotListener ...
func NewSpotListener ¶
func NewSpotListener(instanceID string, metadata *ec2metadata.EC2Metadata, interval time.Duration) *SpotListener
NewSpotListener ...
func (*SpotListener) Start ¶
func (l *SpotListener) Start(ctx context.Context, notices chan<- TerminationNotice, log *logrus.Entry) error
Start the spot termination notice listener.
func (*SpotListener) Type ¶
func (l *SpotListener) Type() string
Type returns a string describing the listener type.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
tools
|
|