cmdlist

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: GPL-3.0 Imports: 7 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 oid.Address) error {
			_, err := io.WriteString(w, fmt.Sprintf("%s\n", addr))
			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.WithReadOnly(true),
		)

		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