[#1714] lens: Add open*COMPONENT* funcs

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-08-24 15:09:52 +03:00 committed by LeL
parent 01d7c007aa
commit fa18100489
10 changed files with 58 additions and 60 deletions

View file

@ -1,6 +1,11 @@
package writecache
import "github.com/spf13/cobra"
import (
common "github.com/nspcc-dev/neofs-node/cmd/neofs-lens/internal"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/writecache"
"github.com/spf13/cobra"
"go.etcd.io/bbolt"
)
var (
vAddress string
@ -17,3 +22,10 @@ var Root = &cobra.Command{
func init() {
Root.AddCommand(listCMD, inspectCMD)
}
func openWC(cmd *cobra.Command) *bbolt.DB {
db, err := writecache.OpenDB(vPath, true)
common.ExitOnErr(cmd, common.Errf("could not open write-cache db: %w", err))
return db
}