View Source CensysEx.Paginate (censys_ex v1.2.3)

CensysEx.Paginate implements a wrapper for cursor paginated APIs

Link to this section Summary

Types

function that takes in a keyword list of query params and returns either a map of results or an error

function that takes in the internal results of paginated API calls, returning a [any]

t()

struct to maintain the state of a paginated api call

Link to this section Types

@type next_page_fn() :: (Keyword.t() -> CensysEx.result())

function that takes in a keyword list of query params and returns either a map of results or an error

@type result_extractor() :: (t() -> [any()])

function that takes in the internal results of paginated API calls, returning a [any]

@type t() :: %CensysEx.Paginate{
  cursor: String.t(),
  next_fn: next_page_fn(),
  page: integer(),
  params: Keyword.t(),
  results: map(),
  results_fn: result_extractor()
}

struct to maintain the state of a paginated api call

Link to this section Functions

Link to this function

stream(next_fn, results_fn, params \\ Keyword.new())

View Source