2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-25 06:07:44 +00:00
restic/internal/backend/limiter/limiter.go
Andrea Gelmini 241916d55b
Fix typos
2023-12-06 13:11:55 +01:00

30 lines
854 B
Go

package limiter
import (
"io"
"net/http"
)
// Limiter defines an interface that implementers can use to rate limit I/O
// according to some policy defined and configured by the implementer.
type Limiter interface {
// Upstream returns a rate limited reader that is intended to be used in
// uploads.
Upstream(r io.Reader) io.Reader
// UpstreamWriter returns a rate limited writer that is intended to be used
// in uploads.
UpstreamWriter(w io.Writer) io.Writer
// Downstream returns a rate limited reader that is intended to be used
// for downloads.
Downstream(r io.Reader) io.Reader
// Downstream returns a rate limited reader that is intended to be used
// for downloads.
DownstreamWriter(r io.Writer) io.Writer
// Transport returns an http.RoundTripper limited with the limiter.
Transport(http.RoundTripper) http.RoundTripper
}