Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

implement pagination for aws rrs and lb #34

Merged
merged 4 commits into from
Jan 3, 2017
Merged

implement pagination for aws rrs and lb #34

merged 4 commits into from
Jan 3, 2017

Conversation

ideahitme
Copy link
Contributor

No description provided.

break
}

records = append(records, rsp.ResourceRecordSets...)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can use this helper method to do the pagination.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -14,6 +17,9 @@ type LoadBalancer struct {
CanonicalZoneID string
}

//LoadBalancerExtractor is a func type which is extract Classic and Application Loadbalancer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: which is extract => which extracts maybe? also explain the use case (e.g. extract from what)

})
}

if aws.StringValue(resp.NextMarker) == "" {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pagination helper could get rid of the manual marker stuff https://godoc.org/github.com/aws/aws-sdk-go/service/elb#ELB.DescribeLoadBalancersPages

if aws.StringValue(resp.NextMarker) == "" {
break
}
params.SetMarker(aws.StringValue(resp.NextMarker))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return result, nil

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stray line :)

@ideahitme
Copy link
Contributor Author

@linki thanks for the review, added the changes to use aws-sdk to implement pagination

@linki
Copy link
Owner

linki commented Jan 3, 2017

👍

@linki linki merged commit 91525ed into master Jan 3, 2017
@ideahitme ideahitme deleted the pagination branch January 27, 2017 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants