cmdapp

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateCmd = &cobra.Command{

	Use: "create <name> [input]",

	Short: "Create a Studios app",

	Long: createLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Name'")
			cmd.Usage()
			os.Exit(1)
		}

		var name string

		if 0 < len(args) {

			name = args[0]

		}

		if 1 >= len(args) {
			fmt.Println("missing required argument: 'Input'")
			cmd.Usage()
			os.Exit(1)
		}

		var input string

		if 1 < len(args) {

			input = args[1]

		}

		err = CreateRun(name, input)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var DeleteCmd = &cobra.Command{

	Use: "delete <name or id>",

	Short: "Delete a Studios app.",

	Long: deleteLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = DeleteRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var DeployCmd = &cobra.Command{

	Use: "deploy <name> <input>",

	Short: "Deploy a Studios app",

	Long: deployLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Name'")
			cmd.Usage()
			os.Exit(1)
		}

		var name string

		if 0 < len(args) {

			name = args[0]

		}

		if 1 >= len(args) {
			fmt.Println("missing required argument: 'Input'")
			cmd.Usage()
			os.Exit(1)
		}

		var input string

		if 1 < len(args) {

			input = args[1]

		}

		err = DeployRun(name, input)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var GetCmd = &cobra.Command{

	Use: "get <name or id>",

	Short: "Get a Studios app",

	Long: getLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = GetRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var ListCmd = &cobra.Command{

	Use: "list",

	Short: "List your apps",

	Long: listLong,

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

		err = ListRun(args)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var PullCmd = &cobra.Command{

	Use: "pull <name or id>",

	Short: "Pull a Studios app.",

	Long: pullLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = PullRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var PushCmd = &cobra.Command{

	Use: "push <name or id>",

	Short: "Push a Studios app.",

	Long: pushLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = PushRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var ResetCmd = &cobra.Command{

	Use: "reset <name or id>",

	Short: "Reset a Studios app.",

	Long: resetLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = ResetRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var ShutdownCmd = &cobra.Command{

	Use: "shutdown <name or id>",

	Short: "Shutdown a Studios app.",

	Long: shutdownLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = ShutdownRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var StatusCmd = &cobra.Command{

	Use: "status <name or id>",

	Short: "Get the status of a Studios app.",

	Long: statusLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Ident'")
			cmd.Usage()
			os.Exit(1)
		}

		var ident string

		if 0 < len(args) {

			ident = args[0]

		}

		err = StatusRun(ident)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var UpdateCmd = &cobra.Command{

	Use: "update <name> <input>",

	Short: "Update a Studios app",

	Long: updateLong,

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

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'Name'")
			cmd.Usage()
			os.Exit(1)
		}

		var name string

		if 0 < len(args) {

			name = args[0]

		}

		if 1 >= len(args) {
			fmt.Println("missing required argument: 'Input'")
			cmd.Usage()
			os.Exit(1)
		}

		var input string

		if 1 < len(args) {

			input = args[1]

		}

		err = UpdateRun(name, input)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}

Functions

func CreateRun

func CreateRun(name string, input string) (err error)

func DeleteRun

func DeleteRun(ident string) (err error)

func DeployRun

func DeployRun(name string, input string) (err error)

func GetRun

func GetRun(ident string) (err error)

func ListRun

func ListRun(args []string) (err error)

func PullRun

func PullRun(ident string) (err error)

func PushRun

func PushRun(ident string) (err error)

func ResetRun

func ResetRun(ident string) (err error)

func ShutdownRun

func ShutdownRun(ident string) (err error)

func StatusRun

func StatusRun(ident string) (err error)

func UpdateRun

func UpdateRun(name string, input string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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