Documentation ¶
Index ¶
- func GetInstances(c context.Context, api EC2DescribeInstancesAPI, ...) (*ec2.DescribeInstancesOutput, error)
- func Inspect(id string) error
- func List() error
- func Start(instance string) error
- func StartInstance(c context.Context, api EC2StartInstancesAPI, input *ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error)
- func Stop(instance string) error
- func StopInstance(c context.Context, api EC2StopInstancesAPI, input *ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error)
- type EC2DescribeInstancesAPI
- type EC2StartInstancesAPI
- type EC2StopInstancesAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInstances ¶
func GetInstances(c context.Context, api EC2DescribeInstancesAPI, input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
GetInstances retrieves information about your Amazon Elastic Compute Cloud (Amazon EC2) instances. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a DescribeInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to DescribeInstances.
func StartInstance ¶
func StartInstance(c context.Context, api EC2StartInstancesAPI, input *ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error)
StartInstance starts an Amazon Elastic Compute Cloud (Amazon EC2) instance. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a StartInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to StartInstances.
func StopInstance ¶
func StopInstance(c context.Context, api EC2StopInstancesAPI, input *ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error)
StopInstance stops an Amazon Elastic Compute Cloud (Amazon EC2) instance. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a StopInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to StopInstances.
Types ¶
type EC2DescribeInstancesAPI ¶
type EC2DescribeInstancesAPI interface { DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error) }
EC2DescribeInstancesAPI defines the interface for the DescribeInstances function. We use this interface to test the function using a mocked service.
type EC2StartInstancesAPI ¶
type EC2StartInstancesAPI interface { StartInstances(ctx context.Context, params *ec2.StartInstancesInput, optFns ...func(*ec2.Options)) (*ec2.StartInstancesOutput, error) }
EC2StartInstancesAPI defines the interface for the StartInstances function. We use this interface to test the function using a mocked service.
type EC2StopInstancesAPI ¶
type EC2StopInstancesAPI interface { StopInstances(ctx context.Context, params *ec2.StopInstancesInput, optFns ...func(*ec2.Options)) (*ec2.StopInstancesOutput, error) }
EC2StopInstancesAPI defines the interface for the StopInstances function. We use this interface to test the function using a mocked service.