Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MakeInputFileCmd = &cobra.Command{ Use: "make-input-file", Short: "make input file skelton for exec", Run: func(cmd *cobra.Command, args []string) { input.MakeInputFile(input.RemotePortForwardInput{}, "remoteportforward-input.json") }, }
View Source
var RemoteportforwardCmd = &cobra.Command{ Use: "remoteportforward", Short: "like start-session --document-name AWS-StartPortForwardingSessionToRemote", Run: func(cmd *cobra.Command, args []string) { var remotePortforwardInput input.RemotePortForwardInput inputFile, err := cmd.Flags().GetString(inputFileName) if err != nil { log.Fatalln(err) } if inputFile != "" { input.ReadInputFile(&remotePortforwardInput, inputFile) } if remotePortforwardInput.RemotePortNumber == "" { remote, err := cmd.Flags().GetString("remote-port") if err != nil { log.Fatalln(err) } remotePortforwardInput.RemotePortNumber = remote } if remotePortforwardInput.LocalPortNumber == "" { local, err := cmd.Flags().GetString("local-port") if err != nil { log.Fatalln(err) } if local == "" { l, err := port.AvailablePort() if err != nil { log.Fatalln(err) } local = strconv.Itoa(l) } remotePortforwardInput.LocalPortNumber = local } if remotePortforwardInput.Host == "" { host, err := cmd.Flags().GetString("host") if err != nil { log.Fatalln(err) } remotePortforwardInput.Host = host } errorMsgs := validateInput(remotePortforwardInput) if len(errorMsgs) != 0 { log.Fatalln(strings.Join(errorMsgs, "\n")) } err = handler.RemotePortforwardHandler(remotePortforwardInput) if err != nil { log.Fatalln(err) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.