8000 Tags · aead/mem · GitHub
[go: up one dir, main page]

Skip to content

Tags

Tags

v0.2.0

Toggle v0.2.0's commit message
add `Progress` and `ProgressReader` types

This commit adds two new types for measuring
progress of I/O operations.

A `Progress` represents the status of an I/O
operation. It contains the number of bytes
read since the last progress reporting, the
number of bytes processed in total so far and
a potential error.

The `ProgressReader` wraps an `io.Reader` and
sends progress updates to its `Update` callback.
By default, it calls the `Update` callback after
every completed read. However, users can specify:
 - an `UpdateAfter` size causing the `ProgressReader`
   to invoke the callback once it has read at least
   `UpdateAfter` bytes since the last update.
 - an `UpdateEvery` duration causing the `ProgressReader`
   to invoke the callback only if no update has happened
   for at least `UpdateEvery` time period.

Signed-off-by: Andreas Auernhammer <hi@aead.dev>

v0.1.0

Toggle v0.1.0's commit message
improve package-level docs

Signed-off-by: Andreas Auernhammer <hi@aead.dev>
0