Files
kopia/cli/command_server_status.go
Jarek Kowalski 9a6dea898b Linter upgrade to v1.30.0 (#526)
* fixed godot linter errors
* reformatted source with gofumpt
* disabled some linters
* fixed nolintlint warnings
* fixed gci warnings
* lint: fixed 'nestif' warnings
* lint: fixed 'exhaustive' warnings
* lint: fixed 'gocritic' warnings
* lint: fixed 'noctx' warnings
* lint: fixed 'wsl' warnings
* lint: fixed 'goerr113' warnings
* lint: fixed 'gosec' warnings
* lint: upgraded linter to 1.30.0
* lint: more 'exhaustive' warnings

Co-authored-by: Nick <nick@kasten.io>
2020-08-12 19:28:53 -07:00

29 lines
601 B
Go

package cli
import (
"context"
"fmt"
"github.com/kopia/kopia/internal/apiclient"
"github.com/kopia/kopia/internal/serverapi"
)
var serverStatusCommand = serverCommands.Command("status", "Status of Kopia server")
func init() {
serverStatusCommand.Action(serverAction(runServerStatus))
}
func runServerStatus(ctx context.Context, cli *apiclient.KopiaAPIClient) error {
var status serverapi.SourcesResponse
if err := cli.Get(ctx, "sources", nil, &status); err != nil {
return err
}
for _, src := range status.Sources {
fmt.Printf("%15v %v\n", src.Status, src.Source)
}
return nil
}