cmd

package
v0.76.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "devopstools",
	Short: "Scripts to drive Vega Networks",
	Long:  `Manage internal Vega Networks`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		var err error
		cfg := zap.NewProductionConfig()
		if Args.Debug {
			cfg.Level.SetLevel(zap.DebugLevel)
		}

		cfg.OutputPaths = []string{"stdout"}
		cfg.Encoding = "console"
		cfg.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
		Args.Logger, err = cfg.Build()
		if err != nil {
			fmt.Fprintf(os.Stderr, "Failed to setup logger: %s\n", err)
			os.Exit(1)
		}
	},
}

Functions

func Execute

func Execute()

Types

type RootArgs

type RootArgs struct {
	Debug  bool
	Logger *zap.Logger
}
var Args RootArgs

Jump to

Keyboard shortcuts

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