capacity

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoScalingGroup

type AutoScalingGroup struct {
	OriginalDesiredCapacity *int32
	OriginalMaxSize         *int32
	StateSavedAt            *time.Time

	autoscalingtypes.AutoScalingGroup
	// contains filtered or unexported fields
}

func NewAutoScalingGroup

func NewAutoScalingGroup(name string, asSvc AutoScalingAPI, ec2Svc EC2API) (*AutoScalingGroup, error)

func (*AutoScalingGroup) ReduceCapacity

func (asg *AutoScalingGroup) ReduceCapacity(ctx context.Context, amount int32, drainer Drainer) error

func (*AutoScalingGroup) ReplaceInstances

func (asg *AutoScalingGroup) ReplaceInstances(ctx context.Context, drainer Drainer, cluster Cluster) error

type Cluster added in v0.1.3

type Cluster interface {
	Name() string
	WaitUntilContainerInstancesRegistered(context.Context, int, *time.Time) error
}

func NewCluster added in v0.1.3

func NewCluster(name string, ecsSvc ECSAPI) Cluster

type Drainer

type Drainer interface {
	Drain(context.Context, []string) error
	ProcessInterruptions(context.Context, []sqstypes.Message) ([]sqstypes.DeleteMessageBatchRequestEntry, error)
}

func NewDrainer

func NewDrainer(cluster string, batchSize int32, ecsSvc ECSAPI) (Drainer, error)

type SQSAPI added in v0.1.3

type SQSAPI interface {
	DeleteMessageBatch(context.Context, *sqs.DeleteMessageBatchInput, ...func(*sqs.Options)) (*sqs.DeleteMessageBatchOutput, error)
	ReceiveMessage(context.Context, *sqs.ReceiveMessageInput, ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error)
}

type SQSQueuePoller

type SQSQueuePoller struct {
	// contains filtered or unexported fields
}

func NewSQSQueuePoller

func NewSQSQueuePoller(queueURL string, sqsSvc SQSAPI) *SQSQueuePoller

func (*SQSQueuePoller) Poll

func (*SQSQueuePoller) PollOnce

func (p *SQSQueuePoller) PollOnce(ctx context.Context, callback func([]sqstypes.Message) ([]sqstypes.DeleteMessageBatchRequestEntry, error), waitTimeSeconds int32) error

type SpotFleetRequest

type SpotFleetRequest struct {
	SpotFleetRequestConfigData *ec2types.SpotFleetRequestConfigData

	ec2types.SpotFleetRequestConfig
	// contains filtered or unexported fields
}

func NewSpotFleetRequest

func NewSpotFleetRequest(id string, ec2Svc EC2API) (*SpotFleetRequest, error)

func (*SpotFleetRequest) ReduceCapacity

func (sfr *SpotFleetRequest) ReduceCapacity(ctx context.Context, amount int32, drainer Drainer, poller Poller) error

func (*SpotFleetRequest) TerminateAllInstances

func (sfr *SpotFleetRequest) TerminateAllInstances(ctx context.Context, drainer Drainer) error

Jump to

Keyboard shortcuts

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