mirror of
https://github.com/restic/restic.git
synced 2024-12-27 02:08:37 +00:00
32637a0328
Added `--limit-upload` and `--limit-download` flags to rate limit backups and restores.
17 lines
457 B
Go
17 lines
457 B
Go
package limiter
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// Limiter defines an interface that implementors can use to rate limit I/O
|
|
// according to some policy defined and configured by the implementor.
|
|
type Limiter interface {
|
|
// Upstream returns a rate limited reader that is intended to be used in
|
|
// uploads.
|
|
Upstream(r io.Reader) io.Reader
|
|
|
|
// Downstream returns a rate limited reader that is intended to be used
|
|
// for downloads.
|
|
Downstream(r io.Reader) io.Reader
|
|
}
|