mirror of https://github.com/docker/compose.git
Prefer AWS API interface over actual implementation
This will help introduce mock-based tests Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
dd48cc4599
commit
4e72d1892a
|
@ -3,11 +3,18 @@ package amazon
|
||||||
import (
|
import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
|
"github.com/aws/aws-sdk-go/service/cloudformation"
|
||||||
|
"github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface"
|
||||||
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
|
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
|
||||||
|
"github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
"github.com/aws/aws-sdk-go/service/ecs"
|
"github.com/aws/aws-sdk-go/service/ecs"
|
||||||
|
"github.com/aws/aws-sdk-go/service/ecs/ecsiface"
|
||||||
"github.com/aws/aws-sdk-go/service/elbv2"
|
"github.com/aws/aws-sdk-go/service/elbv2"
|
||||||
|
"github.com/aws/aws-sdk-go/service/elbv2/elbv2iface"
|
||||||
"github.com/aws/aws-sdk-go/service/iam"
|
"github.com/aws/aws-sdk-go/service/iam"
|
||||||
|
"github.com/aws/aws-sdk-go/service/iam/iamiface"
|
||||||
"github.com/docker/ecs-plugin/pkg/compose"
|
"github.com/docker/ecs-plugin/pkg/compose"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -35,6 +42,7 @@ func NewClient(profile string, cluster string, region string) (compose.API, erro
|
||||||
ELB: elbv2.New(sess),
|
ELB: elbv2.New(sess),
|
||||||
CW: cloudwatchlogs.New(sess),
|
CW: cloudwatchlogs.New(sess),
|
||||||
IAM: iam.New(sess),
|
IAM: iam.New(sess),
|
||||||
|
CF: cloudformation.New(sess),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +50,12 @@ type client struct {
|
||||||
Cluster string
|
Cluster string
|
||||||
Region string
|
Region string
|
||||||
sess *session.Session
|
sess *session.Session
|
||||||
ECS *ecs.ECS
|
ECS ecsiface.ECSAPI
|
||||||
EC2 *ec2.EC2
|
EC2 ec2iface.EC2API
|
||||||
ELB *elbv2.ELBV2
|
ELB elbv2iface.ELBV2API
|
||||||
CW *cloudwatchlogs.CloudWatchLogs
|
CW cloudwatchlogsiface.CloudWatchLogsAPI
|
||||||
IAM *iam.IAM
|
IAM iamiface.IAMAPI
|
||||||
|
CF cloudformationiface.CloudFormationAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ compose.API = &client{}
|
var _ compose.API = &client{}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
package amazon
|
Loading…
Reference in New Issue