cmd

package
v0.0.0-...-0cee181 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HelmReleaseName string
View Source
var Namespace string
View Source
var RootCmd = &cobra.Command{
	Use:   "tobs",
	Short: "A CLI tool for The Observablity Stack",
	Long: `The Observability Stack is a tool that uses TimescaleDB as a 
compressed long-term store for time series metrics from Prometheus. This
application is a CLI tool that allows users to quickly access the different
components of Observability.`,
	SilenceUsage: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		var err error

		HelmReleaseName, err = cmd.Flags().GetString("name")
		if err != nil {
			return fmt.Errorf("could not read global flag: %w", err)
		}

		Namespace, err = cmd.Flags().GetString("namespace")
		if err != nil {
			return fmt.Errorf("could not read global flag: %w", err)
		}

		return nil
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func AddRootFlags

func AddRootFlags(cmd *cobra.Command)

func Execute

func Execute()

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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