commands

package
v0.0.0-...-691b052 Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: Apache-2.0 Imports: 76 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Buildstamp = ""
View Source
var RootCmd = &cobra.Command{
	Use:   "bitfan",
	Short: "Produce, transform and consume any data",
	Long:  `Bitfan is an open source data processing pipeline`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		initSettings(cmd)
		viper.BindPFlag("workers", cmd.Flags().Lookup("workers"))
		viper.BindPFlag("log", cmd.Flags().Lookup("log"))
		viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose"))
		viper.BindPFlag("debug", cmd.Flags().Lookup("debug"))
		viper.BindPFlag("data", cmd.Flags().Lookup("data"))
		viper.BindPFlag("host", cmd.Flags().Lookup("host"))
	},
	Run: func(cmd *cobra.Command, args []string) {

		var configtest = cmd.Flags().Lookup("configtest")
		var eval = cmd.Flags().Lookup("eval")
		var configLocation = cmd.Flags().Lookup("config")
		var version = cmd.Flags().Lookup("version")

		if version.Changed {
			versionCmd.Run(cmd, args)
		} else if configtest.Changed {
			var targs []string
			if configLocation.Changed {
				targs = []string{configLocation.Value.String()}
			} else if eval.Changed {
				targs = []string{eval.Value.String()}
			}
			testCmd.Run(cmd, targs)
		} else if eval.Changed {
			targs := []string{eval.Value.String()}
			runCmd.Run(cmd, targs)
		} else if configLocation.Changed {
			targs := []string{configLocation.Value.String()}
			runCmd.Run(cmd, targs)
		} else {
			cmd.Help()
		}

	},
}

RootCmd represents the base command when called without any subcommands

View Source
var Version = "No Version Provided"

Functions

func Execute

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.

func GetService

func GetService() service.Service

Types

This section is empty.

Jump to

Keyboard shortcuts

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