resources: aws: ec2: Move chanStruct type out of longpollWatch
This commit is contained in:
@@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user