Skip to content

Commit

Permalink
Adapt to iterator API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Jun 6, 2019
1 parent f5e10f6 commit ecdc493
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ func (p *ObjectPrinter) Print(objType string, args []string, argRe *regexp.Regex
// specified by the collection URL.
func (p *ObjectPrinter) PrintCollection(collection *url.URL) error {
it, err := p.client.Iterator(collection,
vt.WithLimit(viper.GetInt("limit")),
vt.WithCursor(viper.GetString("cursor")),
vt.WithFilter(viper.GetString("filter")))
vt.IteratorLimit(viper.GetInt("limit")),
vt.IteratorCursor(viper.GetString("cursor")),
vt.IteratorFilter(viper.GetString("filter")))
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/retrohunt.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func retrohuntListTable(cmd *cobra.Command) error {

it, err := client.Iterator(
vt.URL("intelligence/retrohunt_jobs"),
vt.WithLimit(limit),
vt.WithFilter(viper.GetString("filter")))
vt.IteratorLimit(limit),
vt.IteratorFilter(viper.GetString("filter")))

if err != nil {
return err
Expand Down
16 changes: 8 additions & 8 deletions cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ func runSearchCmd(cmd *cobra.Command, args []string) error {
}

it, err := client.Search(args[0],
vt.WithLimit(viper.GetInt("limit")),
vt.WithCursor(viper.GetString("cursor")),
vt.WithBatchSize(batchSize),
vt.WithDescriptorsOnly(
vt.IteratorLimit(viper.GetInt("limit")),
vt.IteratorCursor(viper.GetString("cursor")),
vt.IteratorBatchSize(batchSize),
vt.IteratorDescriptorsOnly(
viper.GetBool("identifiers-only") || viper.GetBool("download")))

if err != nil {
Expand Down Expand Up @@ -180,10 +180,10 @@ func runContentSearchCmd(cmd *cobra.Command, args []string) error {
}

it, err := client.Search(strings.Join(terms, " "),
vt.WithLimit(viper.GetInt("limit")),
vt.WithCursor(viper.GetString("cursor")),
vt.WithBatchSize(batchSize),
vt.WithDescriptorsOnly(
vt.IteratorLimit(viper.GetInt("limit")),
vt.IteratorCursor(viper.GetString("cursor")),
vt.IteratorBatchSize(batchSize),
vt.IteratorDescriptorsOnly(
viper.GetBool("identifiers-only") || viper.GetBool("download")))

if err != nil {
Expand Down

0 comments on commit ecdc493

Please sign in to comment.