resources: aws: ec2: Move chanStruct type out of longpollWatch

This commit is contained in:
Jonathan Gold
2017-11-08 16:08:25 -05:00
parent 567a2e9fd8
commit db49fe85e4

View File

@@ -84,6 +84,12 @@ type AwsEc2Res struct {
client *ec2.EC2 // client session for AWS API calls client *ec2.EC2 // client session for AWS API calls
} }
// chanStruct defines the type for a channel used to pass events and errors to watch.
type chanStruct struct {
str string
err error
}
// Default returns some sensible defaults for this resource. // Default returns some sensible defaults for this resource.
func (obj *AwsEc2Res) Default() Res { func (obj *AwsEc2Res) Default() Res {
return &AwsEc2Res{ return &AwsEc2Res{
@@ -171,10 +177,6 @@ func (obj *AwsEc2Res) longpollWatch() error {
if err := obj.Running(); err != nil { if err := obj.Running(); err != nil {
return err return err
} }
type chanStruct struct {
str string
err error
}
awsChan := make(chan *chanStruct) awsChan := make(chan *chanStruct)
closeChan := make(chan struct{}) closeChan := make(chan struct{})
ctx, cancel := context.WithCancel(context.TODO()) ctx, cancel := context.WithCancel(context.TODO())