From 5c4ed4642c4359ea8a64db8dc4044248d7a39f60 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Thu, 29 Jun 2023 21:12:28 -0300 Subject: [PATCH] refact: move interface --- providers/aws/ec2/autoscaling_groups.go | 9 ++++++++- providers/aws/ec2/autoscaling_groups_client.go | 15 --------------- 2 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 providers/aws/ec2/autoscaling_groups_client.go diff --git a/providers/aws/ec2/autoscaling_groups.go b/providers/aws/ec2/autoscaling_groups.go index f66e6c7c9..d2b312e28 100644 --- a/providers/aws/ec2/autoscaling_groups.go +++ b/providers/aws/ec2/autoscaling_groups.go @@ -15,6 +15,14 @@ import ( const AWS_SERVICE_NAME_ASG = "AutoScalingGroup" +type AutoScalingGroupClient interface { + DescribeAutoScalingGroups( + ctx context.Context, + params *autoscaling.DescribeAutoScalingGroupsInput, + optFns ...func(*autoscaling.Options), + ) (*autoscaling.DescribeAutoScalingGroupsOutput, error) +} + func AutoScalingGroups(ctx context.Context, clientProvider ProviderClient) ([]Resource, error) { client := autoscaling.NewFromConfig(*clientProvider.AWSClient) @@ -36,7 +44,6 @@ type ASGDiscoverer struct { } func (d ASGDiscoverer) Discover() ([]Resource, error) { - resources := make([]Resource, 0) var queryInput autoscaling.DescribeAutoScalingGroupsInput diff --git a/providers/aws/ec2/autoscaling_groups_client.go b/providers/aws/ec2/autoscaling_groups_client.go deleted file mode 100644 index d27cde24b..000000000 --- a/providers/aws/ec2/autoscaling_groups_client.go +++ /dev/null @@ -1,15 +0,0 @@ -package ec2 - -import ( - "context" - - "github.com/aws/aws-sdk-go-v2/service/autoscaling" -) - -type AutoScalingGroupClient interface { - DescribeAutoScalingGroups( - ctx context.Context, - params *autoscaling.DescribeAutoScalingGroupsInput, - optFns ...func(*autoscaling.Options), - ) (*autoscaling.DescribeAutoScalingGroupsOutput, error) -}