View Source CensysEx.Paginate (censys_ex v2.0.1)

CensysEx.Paginate implements a wrapper for cursor paginated APIs

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

Types

@type next_page_fn() :: (CensysEx.API.t(), 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{
  client: CensysEx.API.t(),
  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

Functions

Link to this function

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

View Source