mirror of
https://github.com/restic/restic.git
synced 2026-11-26 07:19:49 +00:00
cmd/restic, limiter: Move config knowledge to internal packages
The GlobalOptions struct now embeds a backend.TransportOptions, so it doesn't need to construct one in open and create. The upload and download limits are similarly now a struct in internal/limiter that is embedded in GlobalOptions.
This commit is contained in:
1 parent
1dd4b9b60e
commit
90d2c0502b
4 files changed
+29
-38
No files matched your search
@@ -36,7 +36,7 @@ func TestLimitBackendSave(t *testing.T) {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
limiter := NewStaticLimiter(42*1024, 42*1024)
|
||||
limiter := NewStaticLimiter(Limits{42 * 1024, 42 * 1024})
|
||||
limbe := LimitBackend(be, limiter)
|
||||
|
||||
rd := restic.NewByteReader(data, nil)
|
||||
@@ -82,7 +82,7 @@ func TestLimitBackendLoad(t *testing.T) {
|
||||
}
|
||||
return newTracedReadCloser(src), nil
|
||||
}
|
||||
limiter := NewStaticLimiter(42*1024, 42*1024)
|
||||
limiter := NewStaticLimiter(Limits{42 * 1024, 42 * 1024})
|
||||
limbe := LimitBackend(be, limiter)
|
||||
|
||||
err := limbe.Load(context.TODO(), testHandle, 0, 0, func(rd io.Reader) error {
|
||||
|
||||
Reference in new issue
Block a user