Files
kopia/cli/command_repository_throttle_get.go
Jarek Kowalski cbc66f936d chore(ci): upgraded linter to 1.53.3 (#3079)
* 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
2023-06-18 13:26:01 -07:00

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
}