cmd

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RootCmd = &cobra.Command{
		Use:   "lanes",
		Short: "Helper for interacting with sets of AWS EC2 instances",

		BashCompletionFunction: bashCompletionFunc,

		Run: func(cmd *cobra.Command, args []string) {
			cmd.Usage()
		},
	}

	Config *lanes.Config
)
View Source
var (
	ErrCanceled = errors.New("Canceled")
)

Functions

func CheckSourceFiles

func CheckSourceFiles(sources ...string) (err error)

CheckSourceFiles ensures that each provided path points to an accessible file.

func ChooseServer

func ChooseServer(lane, keyword string) (svr *lanes.Server, err error)

ChooseServer displays a table of all instances in the specified lane and prompts the user to select one server before proceeding with the calling operation.

func ConnectToServer

func ConnectToServer(svr *lanes.Server, args ...string) (err error)

ConnectToServer uses the specified server's lane to correctly connect to the desired server.

func CopyToServers

func CopyToServers(servers []*lanes.Server, dest string, sources ...string) (err error)

CopyToServers uses the provided SSH profile to copy one or more files to all provided servers.

func DisplayAndConfirm

func DisplayAndConfirm(servers []*lanes.Server, prompt string, confirm bool) (err error)

DisplayAndConfirm displays a table with the specified servers and requires the user to confirm their intentions before allowing the calling operation to continue.

func DisplayFilteredLaneAndConfirm added in v0.3.0

func DisplayFilteredLaneAndConfirm(lane, keyword, prompt string, confirm bool) (servers []*lanes.Server, err error)

DisplayFilteredLaneAndConfirm displays a table of instances in the specified lane that match the specified keyword and requires the user to confirm their intentions before allowing the calling operation to continue.

func DisplayLaneAndConfirm

func DisplayLaneAndConfirm(lane, prompt string, confirm bool) (servers []*lanes.Server, err error)

DisplayLaneAndConfirm displays a table of all instances in the specified lane and requires the user to confirm their intentions before allowing the calling operation to continue.

func Execute

func Execute() (err error)

func Prompt

func Prompt(prompt string, parser InputParseFunction) (err error)

Prompt displays a regular prompt for user input.

func PromptHideInput added in v0.2.0

func PromptHideInput(prompt string, parser InputParseFunction, hideInput bool) (err error)

PromptHideInput displays a prompt for user input, optionally hiding user input. The prompt is displayed until the user's input is deemed valid.

func ReadInput added in v0.2.0

func ReadInput(hideInput bool) (out string, err error)

ReadInput accepts user input, optionally hiding user input for sensitive data.

func RequireProfile

func RequireProfile(cmd *cobra.Command, args []string) (err error)

RequireProfile ensures that a valid profile is configured before allowing certain commands to proceed.

func SwitchToProfile added in v0.3.0

func SwitchToProfile(cmd *cobra.Command, args []string) (err error)

Types

type InputParseFunction

type InputParseFunction func(string) error

InputParseFunction deal with validating and saving user input to the appropriate variable.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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