loader

package
v0.0.0-...-86c6960 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "TODO",
	Short: "Load tool",
	Args:  cobra.MaximumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		ctx := context.Background()

		client, err := internal.NewMongoClient(ctx, "mongodb://localhost:27018")
		tracelog.ErrorLogger.FatalOnError(err)

		var input io.Reader
		input = os.Stdin
		if ammoFile != "" {
			file, err := os.Open(ammoFile)
			tracelog.ErrorLogger.FatalOnError(err)
			input = file
			defer func() { _ = file.Close() }()
		}

		stat, err := mongoload.HandleLoad(ctx, input, client, 1)
		tracelog.ErrorLogger.FatalOnError(err)

		err = internal.PrintStat(stat, os.Stdout)
		tracelog.ErrorLogger.FatalOnError(err)
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

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