mirror of
https://github.com/kopia/kopia.git
synced 2026-01-25 23:08:01 -05:00
* 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>
29 lines
601 B
Go
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
|
|
}
|