Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kopia wrappers - C] Separate out kopia commands from a single file #1552

Merged
merged 19 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
64845e2
Separate out kopia commands from a single file
shlokc9 Jul 13, 2022
cc7833c
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 15, 2022
38628f3
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 19, 2022
3877cd1
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 19, 2022
64fe948
Rename kopiaArgs to commonArgs
shlokc9 Jul 19, 2022
079cd73
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 20, 2022
878ac67
Combine wrapper functions
shlokc9 Jul 22, 2022
c07cac6
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 22, 2022
f1c69c9
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 22, 2022
b9bd6e7
Fix policyChanges in PolicySetGlobal command wrapper
shlokc9 Jul 22, 2022
be51828
Move command wrapper arguments
shlokc9 Jul 25, 2022
374fcc9
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 25, 2022
314f509
Add CommandArgs struct to pass args to command wrappers
shlokc9 Jul 25, 2022
7061c89
Convert local arguments to exportable arguments
shlokc9 Jul 25, 2022
38bd422
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 25, 2022
8800248
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 25, 2022
38768a6
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 25, 2022
5a3d552
Merge branch 'kopia-wrappers' of github.com:kanisterio/kanister into …
shlokc9 Jul 28, 2022
6139f29
Change log level to Debug
shlokc9 Jul 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions pkg/kopia/command/blob_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2022 The Kanister Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package command

type BlobListCommandCommandArgs struct {
*CommandArgs
}

// BlobList returns the kopia command for listing blobs in the repository with their sizes
func BlobList(blobListArgs BlobListCommandCommandArgs) []string {
args := commonArgs(blobListArgs.EncryptionKey, blobListArgs.ConfigFilePath, blobListArgs.LogDirectory, false)
args = args.AppendLoggable(blobSubCommand, listSubCommand)

return stringSliceCommand(args)
}
27 changes: 27 additions & 0 deletions pkg/kopia/command/blob_stats.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2022 The Kanister Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package command

type BlobStatsCommandCommandArgs struct {
*CommandArgs
}

// BlobStats returns the kopia command to get the blob stats
func BlobStats(blobStatsArgs BlobStatsCommandCommandArgs) []string {
args := commonArgs(blobStatsArgs.EncryptionKey, blobStatsArgs.ConfigFilePath, blobStatsArgs.LogDirectory, false)
args = args.AppendLoggable(blobSubCommand, statsSubCommand, rawFlag)

return stringSliceCommand(args)
}
Loading