-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_aws_client.go
37 lines (27 loc) · 1.05 KB
/
fake_aws_client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package shutter
import (
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/ec2"
)
type fakeAwsClient struct {
AwsClient
ResDescribeAutoscalingGroup *autoscaling.Group
ErrDescribeAutoscalingGroup error
ResDescribeInstance *ec2.Instance
ErrDescribeInstance error
ResDescribeInstanceDetails *autoscaling.InstanceDetails
ErrDescribeInstanceDetails error
ErrCompleteLifecycleAction error
}
func (c *fakeAwsClient) DescribeAutoscalingGroup(name string) (*autoscaling.Group, error) {
return c.ResDescribeAutoscalingGroup, c.ErrDescribeAutoscalingGroup
}
func (c *fakeAwsClient) DescribeInstance(instanceId string) (*ec2.Instance, error) {
return c.ResDescribeInstance, c.ErrDescribeInstance
}
func (c *fakeAwsClient) DescribeInstanceDetails(instanceId string) (*autoscaling.InstanceDetails, error) {
return c.ResDescribeInstanceDetails, c.ErrDescribeInstanceDetails
}
func (c *fakeAwsClient) CompleteLifecycleAction(instanceId string, lifecycleActionResult, lifecycleHook string) error {
return c.ErrCompleteLifecycleAction
}