diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52c3858 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,go +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,go + +### Go ### +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +### Go Patch ### +/vendor/ +/Godeps/ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,go + +msk_file_sd.yml \ No newline at end of file diff --git a/main.go b/main.go index dd1b09c..64da58d 100644 --- a/main.go +++ b/main.go @@ -90,16 +90,20 @@ func getClusters(svc kafkaClient) (*kafka.ListClustersOutput, error) { // getBrokers returns a slice of broker hosts without ports func getBrokers(svc kafkaClient, arn string) ([]string, error) { input := kafka.ListNodesInput{ClusterArn: &arn} - r, err := svc.ListNodes(context.Background(), &input) + var brokers []string - if err != nil { - return nil, err - } + p := kafka.NewListNodesPaginator(svc, &input) + for p.HasMorePages() { + page, err := p.NextPage(context.Background()) + if err != nil { + return nil, err + } - var brokers []string - for _, b := range r.NodeInfoList { - brokers = append(brokers, b.BrokerNodeInfo.Endpoints...) + for _, b := range page.NodeInfoList { + brokers = append(brokers, b.BrokerNodeInfo.Endpoints...) + } } + return brokers, nil }