-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move minio/worker/workstealer subcommands to be under a com…
…ponents/ command subtree Signed-off-by: Nick Mitchell <[email protected]>
- Loading branch information
Showing
11 changed files
with
53 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package subcommands | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"lunchpail.io/cmd/subcommands/component" | ||
) | ||
|
||
func init() { | ||
cmd := &cobra.Command{ | ||
Use: "component", | ||
Short: "Commands related to specific components", | ||
} | ||
rootCmd.AddCommand(cmd) | ||
|
||
cmd.AddCommand(component.Minio()) | ||
cmd.AddCommand(component.Worker()) | ||
cmd.AddCommand(component.WorkStealer()) | ||
} |
14 changes: 6 additions & 8 deletions
14
cmd/subcommands/minio.go → cmd/subcommands/component/minio.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
package subcommands | ||
package component | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"lunchpail.io/cmd/subcommands/minio" | ||
"lunchpail.io/cmd/subcommands/component/minio" | ||
) | ||
|
||
func newMinioCmd() *cobra.Command { | ||
return &cobra.Command{ | ||
func Minio() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "minio", | ||
Short: "Commands for running minio components", | ||
Long: "Commands for running minio components", | ||
} | ||
} | ||
|
||
func init() { | ||
cmd := newMinioCmd() | ||
rootCmd.AddCommand(cmd) | ||
cmd.AddCommand(minio.Server()) | ||
|
||
return cmd | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package component | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"lunchpail.io/cmd/subcommands/component/worker" | ||
) | ||
|
||
func Worker() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "worker", | ||
Short: "Commands that act as an application worker", | ||
Long: "Commands that act as an application worker", | ||
} | ||
|
||
cmd.AddCommand(worker.Run()) | ||
cmd.AddCommand(worker.PreStop()) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters