Files
kopia/cli/command_server_refresh.go
Jarek Kowalski 30ca3e2e6c Upgraded linter to 1.40.1 (#1072)
* tools: upgraded linter to 1.40.1

* lint: fixed nolintlint vionlations

* lint: disabled tagliatele linter

* lint: fixed remaining warnings
2021-05-15 12:12:34 -07:00

24 lines
620 B
Go

package cli
import (
"context"
"github.com/kopia/kopia/internal/apiclient"
"github.com/kopia/kopia/internal/serverapi"
)
type commandServerRefresh struct {
sf serverClientFlags
}
func (c *commandServerRefresh) setup(svc appServices, parent commandParent) {
cmd := parent.Command("refresh", "Refresh the cache in Kopia server to observe new sources, etc.")
c.sf.setup(cmd)
cmd.Action(svc.serverAction(&c.sf, c.run))
}
func (c *commandServerRefresh) run(ctx context.Context, cli *apiclient.KopiaAPIClient) error {
// nolint:wrapcheck
return cli.Post(ctx, "refresh", &serverapi.Empty{}, &serverapi.Empty{})
}