Files
kopia/cli/command_repository_throttle_get.go
Julio Lopez 8098f49c90 chore(ci): remove exclusion for unused ctx parameters (#4530)
Remove unused-parameter exclusion for `ctx` in revive linter.

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-26 23:11:36 -07:00

31 lines
638 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(_ 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
}