Documentation ¶
Index ¶
- Variables
- func CheckSourceFiles(sources ...string) (err error)
- func ChooseServer(lane, keyword string) (svr *lanes.Server, err error)
- func ConnectToServer(svr *lanes.Server, args ...string) (err error)
- func CopyToServers(servers []*lanes.Server, dest string, sources ...string) (err error)
- func DisplayAndConfirm(servers []*lanes.Server, prompt string, confirm bool) (err error)
- func DisplayFilteredLaneAndConfirm(lane, keyword, prompt string, confirm bool) (servers []*lanes.Server, err error)
- func DisplayLaneAndConfirm(lane, prompt string, confirm bool) (servers []*lanes.Server, err error)
- func Execute() (err error)
- func Prompt(prompt string, parser InputParseFunction) (err error)
- func PromptHideInput(prompt string, parser InputParseFunction, hideInput bool) (err error)
- func ReadInput(hideInput bool) (out string, err error)
- func RequireProfile(cmd *cobra.Command, args []string) (err error)
- func SwitchToProfile(cmd *cobra.Command, args []string) (err error)
- type InputParseFunction
Constants ¶
This section is empty.
Variables ¶
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 )
var (
ErrCanceled = errors.New("Canceled")
)
Functions ¶
func CheckSourceFiles ¶
CheckSourceFiles ensures that each provided path points to an accessible file.
func ChooseServer ¶
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 ¶
ConnectToServer uses the specified server's lane to correctly connect to the desired server.
func CopyToServers ¶
CopyToServers uses the provided SSH profile to copy one or more files to all provided servers.
func DisplayAndConfirm ¶
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 ¶
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 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
ReadInput accepts user input, optionally hiding user input for sensitive data.
func RequireProfile ¶
RequireProfile ensures that a valid profile is configured before allowing certain commands to proceed.
Types ¶
type InputParseFunction ¶
InputParseFunction deal with validating and saving user input to the appropriate variable.