-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 divided into several files because large struct
- Loading branch information
stormcat24
committed
Jul 10, 2015
1 parent
27dc8aa
commit 66f1592
Showing
5 changed files
with
105 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package aws | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/ecs" | ||
"github.com/aws/aws-sdk-go/aws/credentials" | ||
) | ||
|
||
type EcsClusterApi struct { | ||
Credentials *credentials.Credentials | ||
Region string | ||
} | ||
|
||
func (self *EcsClusterApi) CreateCluster(clusterName string) (*ecs.CreateClusterOutput, error) { | ||
|
||
svc := ecs.New(&aws.Config{ | ||
Region: self.Region, | ||
Credentials: self.Credentials, | ||
}) | ||
|
||
params := &ecs.CreateClusterInput{ | ||
ClusterName: aws.String(clusterName), | ||
} | ||
|
||
return svc.CreateCluster(params) | ||
} | ||
|
||
func (self *EcsClusterApi) DeleteCluster(clusterName string) (*ecs.DeleteClusterOutput, error) { | ||
|
||
svc := ecs.New(&aws.Config{ | ||
Region: self.Region, | ||
Credentials: self.Credentials, | ||
}) | ||
|
||
params := &ecs.DeleteClusterInput{ | ||
Cluster: aws.String(clusterName), | ||
} | ||
|
||
return svc.DeleteCluster(params) | ||
} | ||
|
||
func (self *EcsClusterApi) DescribeClusters(clusterNames []*string) (*ecs.DescribeClustersOutput, error) { | ||
|
||
svc := ecs.New(&aws.Config{ | ||
Region: self.Region, | ||
Credentials: self.Credentials, | ||
}) | ||
|
||
params := &ecs.DescribeClustersInput{ | ||
Clusters: clusterNames, | ||
} | ||
|
||
return svc.DescribeClusters(params) | ||
} | ||
|
||
func (self *EcsClusterApi) ListClusters(maxResult int64) (*ecs.ListClustersOutput, error) { | ||
|
||
svc := ecs.New(&aws.Config{ | ||
Region: self.Region, | ||
Credentials: self.Credentials, | ||
}) | ||
|
||
params := &ecs.ListClustersInput{ | ||
MaxResults: aws.Long(maxResult), | ||
} | ||
|
||
return svc.ListClusters(params) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package aws | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws/credentials" | ||
) | ||
|
||
type EcsServiceApi struct { | ||
Credentials *credentials.Credentials | ||
Region string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package aws | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws/credentials" | ||
) | ||
|
||
type EcsTaskApi struct { | ||
Credentials *credentials.Credentials | ||
Region string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters