cmdlist

package
v0.28.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "list",
	Short: "Object listing",
	Long:  `List all objects stored in storage engine component.`,
	Run: func(cmd *cobra.Command, args []string) {

		w := cmd.OutOrStderr()

		wAddr := func(addr *addressSDK.Address) error {
			_, err := io.WriteString(w, addr.String()+"\n")
			return err
		}

		if vWriteCache {
			db, err := writecache.OpenDB(vPath, true)
			common.ExitOnErr(cmd, common.Errf("could not open write-cache db: %w", err))

			defer db.Close()

			err = writecache.IterateDB(db, wAddr)
			common.ExitOnErr(cmd, common.Errf("write-cache iterator failure: %w", err))

			return
		}

		blz := blobovnicza.New(
			blobovnicza.WithPath(vPath),
			blobovnicza.ReadOnly(),
		)

		common.ExitOnErr(cmd, blz.Open())

		defer blz.Close()

		err := blobovnicza.IterateAddresses(blz, wAddr)
		common.ExitOnErr(cmd, common.Errf("blobovnicza iterator failure: %w", err))
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL