mirror of
https://github.com/kopia/kopia.git
synced 2026-01-24 14:28:06 -05:00
* chore(ci): upgraded linter to 1.53.3 This flagged a bunch of unused parameters, so the PR is larger than usual, but 99% mechanical. * separate lint CI task * run Lint in separate CI
31 lines
640 B
Go
31 lines
640 B
Go
package cli
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
"github.com/kopia/kopia/repo"
|
|
)
|
|
|
|
type commandRepositoryThrottleGet struct {
|
|
ctg commonThrottleGet
|
|
}
|
|
|
|
func (c *commandRepositoryThrottleGet) setup(svc appServices, parent commandParent) {
|
|
cmd := parent.Command("get", "Get throttling parameters for a repository")
|
|
c.ctg.setup(svc, cmd)
|
|
|
|
cmd.Action(svc.directRepositoryReadAction(c.run))
|
|
}
|
|
|
|
func (c *commandRepositoryThrottleGet) run(ctx context.Context, rep repo.DirectRepository) error {
|
|
limits := rep.Throttler().Limits()
|
|
|
|
if err := c.ctg.output(&limits); err != nil {
|
|
return errors.Wrap(err, "output")
|
|
}
|
|
|
|
return nil
|
|
}
|