Documentation ¶
Index ¶
- Variables
- func CheckTeamTitle(team *ciscospark.Team) bool
- func Execute()
- func PrintCSV(response interface{})
- func PrintJSON(response interface{})
- func PrintRequestWithBody(request *http.Request, body interface{})
- func PrintRequestWithoutBody(request *http.Request)
- func PrintResponseFormat(response interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var Max int
Max results to return
View Source
var RootCmd = &cobra.Command{ Use: "go-spark", Short: "Displays the help", Long: `Displays the go-spark help`, PersistentPreRun: func(cmd *cobra.Command, args []string) { tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } client := &http.Client{Transport: tr} SparkClient = ciscospark.NewClient(client) var token string viper.BindEnv("CISCO_SPARK_TOKEN") if viper.IsSet("CISCO_SPARK_TOKEN") { token = viper.GetString("CISCO_SPARK_TOKEN") } else if viper.IsSet("token") { token = viper.GetString("token") } else { fmt.Println(cmd.Help()) os.Exit(-1) } SparkClient.Authorization = "Bearer " + token }, }
RootCmd represents the base command when called without any subcommands
View Source
var SparkClient *ciscospark.Client
SparkClient is Cisco Spark Client
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 PrintRequestWithBody ¶
PrintRequestWithBody prints the request with the Body
func PrintRequestWithoutBody ¶
PrintRequestWithoutBody prints the request without the Body, mainly for GET requests
func PrintResponseFormat ¶
func PrintResponseFormat(response interface{})
PrintResponseFormat prints the response depending on the format flag
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.