diff --git a/cmd/openports.go b/cmd/openports.go deleted file mode 100644 index 58c7c42..0000000 --- a/cmd/openports.go +++ /dev/null @@ -1,24 +0,0 @@ -package cmd - -import ( - "fmt" - "github.com/spf13/cobra" -) - -func NewCommandOpenports() *cobra.Command { - spaceCmd := &cobra.Command{ - Use: "openports", - Short: "открыть(пробросить) SSH порты", - RunE: openportsRunE, - } - - return spaceCmd -} - -func openportsRunE(_ *cobra.Command, args []string) error { - fmt.Println("[dummy] openports") - for _, elm := range args { - fmt.Printf("- %s\n", elm) - } - return nil -} diff --git a/cmd/ports.go b/cmd/ports.go new file mode 100644 index 0000000..5aafb8e --- /dev/null +++ b/cmd/ports.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "fmt" + "github.com/spf13/cobra" +) + +func NewCommandPorts() *cobra.Command { + spaceCmd := &cobra.Command{ + Use: "ports", + Short: "работа с пробросом SSH портов", + RunE: portsRunE, + } + + return spaceCmd +} + +func portsRunE(_ *cobra.Command, args []string) error { + fmt.Println("[dummy] ports") + for _, elm := range args { + fmt.Printf("- %s\n", elm) + } + return nil +} diff --git a/cmd/root.go b/cmd/root.go index 067c730..05e5af0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -40,7 +40,7 @@ func init() { rootCmd.AddCommand(NewCommandRole()) rootCmd.AddCommand(NewCommandInstall()) rootCmd.AddCommand(NewCommandHosts()) - //mainCmd.AddCommand(cmd.NewCommandOpenports()) + rootCmd.AddCommand(NewCommandPorts()) rootCmd.AddCommand(NewCommandBackup()) rootCmd.AddCommand(NewCommandRestore()) } diff --git a/internal/space_worker/ports.go b/internal/space_worker/ports.go new file mode 100644 index 0000000..ceae3cb --- /dev/null +++ b/internal/space_worker/ports.go @@ -0,0 +1 @@ +package space_worker diff --git a/internal/types/openports.go b/internal/types/openports.go new file mode 100644 index 0000000..864f342 --- /dev/null +++ b/internal/types/openports.go @@ -0,0 +1,12 @@ +package types + +type TPort struct { + Address string `yaml:"address"` + Port uint16 `yaml:"port"` +} + +type TOpenPort struct { + Name string `yaml:"name"` + Local TPort `yaml:"local"` + Remote TPort `yaml:"remote"` +} diff --git a/target/playbookctl b/target/playbookctl index 1da9bb7..842a1e4 100755 Binary files a/target/playbookctl and b/target/playbookctl differ