awsec2

package
v0.0.0-...-d975249 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstances

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 Inspect

func Inspect(id string) error

func List

func List() error

func Start

func Start(instance string) error

func StartInstance

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 Stop

func Stop(instance string) error

func StopInstance

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.

Jump to

Keyboard shortcuts

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