bleve: github.com/blevesearch/bleve/cmd/bleve/cmd/scorch Index | Files

package scorch

import "github.com/blevesearch/bleve/cmd/bleve/cmd/scorch"

Index

Package Files

ascii.go deleted.go info.go internal.go root.go snapshot.go

Variables

var RootCmd = &cobra.Command{
    Use:   "scorch",
    Short: "command-line tool to interact with a scorch index",
    Long:  `Scorch is a command-line tool to interact with a scorch index.`,
    PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

        if len(args) < 1 {
            return fmt.Errorf("must specify path to scorch index")
        }

        readOnly := true
        config := map[string]interface{}{
            "read_only": readOnly,
            "path":      args[0],
        }

        idx, err := scorch.NewScorch(scorch.Name, config, nil)
        if err != nil {
            return err
        }

        err = idx.Open()
        if err != nil {
            return fmt.Errorf("error opening: %v", err)
        }

        index = idx.(*scorch.Scorch)

        return nil
    },
    PersistentPostRunE: func(cmd *cobra.Command, args []string) error {
        return nil
    },
}

RootCmd represents the base command when called without any subcommands

func Execute Uses

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Package scorch imports 7 packages (graph) and is imported by 1 packages. Updated 2018-05-29. Refresh now. Tools for package owners.