2022-08-23 13:45:24 +00:00
|
|
|
package blobovnicza
|
|
|
|
|
2022-08-24 12:09:52 +00:00
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
common "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-lens/internal"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobovnicza"
|
2022-08-24 12:09:52 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
2022-08-23 13:45:24 +00:00
|
|
|
|
|
|
|
var (
|
|
|
|
vAddress string
|
|
|
|
vPath string
|
|
|
|
vOut string
|
|
|
|
)
|
|
|
|
|
|
|
|
// Root contains `blobovnicza` command definition.
|
|
|
|
var Root = &cobra.Command{
|
|
|
|
Use: "blobovnicza",
|
|
|
|
Short: "Operations with a blobovnicza",
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2024-08-22 12:07:51 +00:00
|
|
|
Root.AddCommand(listCMD, inspectCMD, tuiCMD)
|
2022-08-23 13:45:24 +00:00
|
|
|
}
|
2022-08-24 12:09:52 +00:00
|
|
|
|
|
|
|
func openBlobovnicza(cmd *cobra.Command) *blobovnicza.Blobovnicza {
|
|
|
|
blz := blobovnicza.New(
|
|
|
|
blobovnicza.WithPath(vPath),
|
|
|
|
blobovnicza.WithReadOnly(true),
|
|
|
|
)
|
2024-10-21 08:20:17 +00:00
|
|
|
common.ExitOnErr(cmd, blz.Open(cmd.Context()))
|
2022-08-24 12:09:52 +00:00
|
|
|
|
|
|
|
return blz
|
|
|
|
}
|