Module Object.List

Pagination helpers for ListObjectsV2.

type 'acc fold_step =
  1. | Continue of 'acc
  2. | Stop of 'acc
    (*

    Decision returned by fold_pages_until. Stop returns the accumulator without fetching another page.

    *)
val fold_pages : connection -> bucket:Bucket_name.t -> ?options:Object.List.options -> ?max_pages:int -> init:'acc -> f:('acc -> Object.List.page -> ('acc, Awskit.Error.t) Stdlib.result io) -> unit -> ('acc, Awskit.Error.t) Stdlib.result io

Follow continuation tokens and fold pages until S3 stops returning a next token or max_pages is reached.

val fold_pages_until : connection -> bucket:Bucket_name.t -> ?options:Object.List.options -> ?max_pages:int -> init:'acc -> f: ('acc -> Object.List.page -> ('acc fold_step, Awskit.Error.t) Stdlib.result io) -> unit -> ('acc, Awskit.Error.t) Stdlib.result io

Follow continuation tokens and fold pages until S3 stops returning a next token, max_pages is reached, or f returns Stop.

val pages : connection -> bucket:Bucket_name.t -> ?options:Object.List.options -> max_pages:int -> unit -> (Object.List.page list, Awskit.Error.t) Stdlib.result io

Collect listing pages up to the explicit max_pages bound.

Returns an error if S3 reports more pages than the bound allows.

val objects : connection -> bucket:Bucket_name.t -> ?options:Object.List.options -> max_pages:int -> unit -> (Object.List.object_summary list, Awskit.Error.t) Stdlib.result io

Collect object summaries across listing pages up to max_pages.

val keys : connection -> bucket:Bucket_name.t -> ?options:Object.List.options -> max_pages:int -> unit -> (Object_key.t list, Awskit.Error.t) Stdlib.result io

Collect object keys across listing pages up to max_pages.