Documentation
¶
Overview ¶
Package compute provides a portable compute API with cross-cutting concerns.
Index ¶
- Constants
- func VMTransitions() []statemachine.Transition
- type Compute
- func (c *Compute) DescribeInstances(ctx context.Context, instanceIDs []string, filters []driver.DescribeFilter) ([]driver.Instance, error)
- func (c *Compute) ModifyInstance(ctx context.Context, instanceID string, input driver.ModifyInstanceInput) error
- func (c *Compute) RebootInstances(ctx context.Context, instanceIDs []string) error
- func (c *Compute) RunInstances(ctx context.Context, config driver.InstanceConfig, count int) ([]driver.Instance, error)
- func (c *Compute) StartInstances(ctx context.Context, instanceIDs []string) error
- func (c *Compute) StopInstances(ctx context.Context, instanceIDs []string) error
- func (c *Compute) TerminateInstances(ctx context.Context, instanceIDs []string) error
- type Option
Constants ¶
const ( StatePending = "pending" StateRunning = "running" StateStopping = "stopping" StateStopped = "stopped" StateShuttingDown = "shutting-down" StateTerminated = "terminated" StateRestarting = "restarting" )
VM states.
Variables ¶
This section is empty.
Functions ¶
func VMTransitions ¶
func VMTransitions() []statemachine.Transition
VMTransitions returns the legal VM state transitions.
Types ¶
type Compute ¶
type Compute struct {
// contains filtered or unexported fields
}
Compute is the portable compute type wrapping a driver with cross-cutting concerns.
func NewCompute ¶
NewCompute creates a new portable Compute wrapping the given driver.
func (*Compute) DescribeInstances ¶
func (c *Compute) DescribeInstances(ctx context.Context, instanceIDs []string, filters []driver.DescribeFilter) ([]driver.Instance, error)
DescribeInstances describes instances.
func (*Compute) ModifyInstance ¶
func (c *Compute) ModifyInstance(ctx context.Context, instanceID string, input driver.ModifyInstanceInput) error
ModifyInstance modifies an instance.
func (*Compute) RebootInstances ¶
RebootInstances reboots running instances.
func (*Compute) RunInstances ¶
func (c *Compute) RunInstances(ctx context.Context, config driver.InstanceConfig, count int) ([]driver.Instance, error)
RunInstances creates new VM instances.
func (*Compute) StartInstances ¶
StartInstances starts stopped instances.
func (*Compute) StopInstances ¶
StopInstances stops running instances.
type Option ¶
type Option func(*Compute)
Option configures a portable Compute.
func WithErrorInjection ¶
WithErrorInjection sets the error injector.
func WithMetrics ¶
WithMetrics sets the metrics collector.
func WithRateLimiter ¶
WithRateLimiter sets the rate limiter.