cmd

package
v0.0.0-...-61dbe32 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthsFileName string
View Source
var RootCmd = &cobra.Command{
	Use:   "cloudthing",
	Short: "A CLI client for CloudThing.io",
	Long: `A comand-line client for CloudThing.io Internet of Things cloud platform.
Check out our getting started guides or simply login by typing:
    cloudthing login
If you still don't have an account, just type:
    cloudthing register`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		var logLevel = logger.InfoLevel
		if viper.GetBool("debug") {
			logLevel = logger.DebugLevel
		}
		log = &logger.Logger{
			Level:   logLevel,
			Handler: cli.New(os.Stdout),
		}

		apiServer := viper.GetString("api-server")
		var err error

		ctx, err = api.NewClient(nil, fmt.Sprintf("http://%s", apiServer))
		if err != nil {

			return
		}

		auth := utils.LoadAuth(apiServer)

		if auth != nil {
			ctx.SetTokenAuth(auth)
		}
	},
}

RootCmd represents the base command when called without any subcommands

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.

Types

type RegisterRequest

type RegisterRequest struct {
	Email     string `json:"email"`
	FirstName string `json:"firstName,omitempty"`
	Surname   string `json:"surname,omitempty"`
	OrgName   string `json:"orgName, omitempty"`
	Password  string `json:"password"`
}

type Tenant

type Tenant struct {
	Href         string      `json:"href"`
	Name         string      `json:"name"`
	ShortName    string      `json:"shortName"`
	CreatedAt    *time.Time  `json:"createdAt"`
	UpdatedAt    *time.Time  `json:"updatedAt"`
	Directories  interface{} `json:"directories"`
	Applications interface{} `json:"applications"`
	Products     interface{} `json:"products"`
	Custom       interface{} `json:"custom"`
}

Jump to

Keyboard shortcuts

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