commands

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RetryInterval = time.Second * 12

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "eth2stats-client",
	Short: "Client for eth2stats",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if config != "" {

			abs, err := filepath.Abs(config)
			if err != nil {
				log.Error("Error reading filepath: ", err.Error())
			}

			base := filepath.Base(abs)

			path := filepath.Dir(abs)

			viper.SetConfigName(strings.Split(base, ".")[0])
			viper.AddConfigPath(path)
		}

		viper.AddConfigPath(".")

		if err := viper.ReadInConfig(); err != nil {
			log.Info("Could not load config file. Falling back to args. Error: ", err)
		}

		initLogging()
	},

	Run: func(cmd *cobra.Command, args []string) {

		cmd.HelpFunc()(cmd, args)
	},
}

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