This is an automated email from the ASF dual-hosted git repository.
zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git
The following commit(s) were added to refs/heads/master by this push:
new c37d7b8e [dubboctl] initial repo logic v2 (#555)
c37d7b8e is described below
commit c37d7b8ee87eab1fd923b379182e9d47f4baca72
Author: Jian Zhong <[email protected]>
AuthorDate: Mon Jan 20 20:27:39 2025 +0800
[dubboctl] initial repo logic v2 (#555)
---
dubboctl/cmd/repo.go | 48 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 40 insertions(+), 8 deletions(-)
diff --git a/dubboctl/cmd/repo.go b/dubboctl/cmd/repo.go
index 39db9bfd..47a03ecc 100644
--- a/dubboctl/cmd/repo.go
+++ b/dubboctl/cmd/repo.go
@@ -15,6 +15,9 @@ func addRepoFlags(cmd *cobra.Command, rArgs *repoArgs) {
func RepoCmd(_ cli.Context, cmd *cobra.Command, clientFactory ClientFactory)
*cobra.Command {
rootArgs := &cluster.RootArgs{}
rArgs := &repoArgs{}
+ ad := addCmd(cmd, clientFactory)
+ li := listCmd(cmd, clientFactory)
+ re := removeCmd(cmd, clientFactory)
rc := &cobra.Command{
Use: "repo",
Short: "Manage existing Dubbo SDK module libraries",
@@ -29,31 +32,60 @@ func RepoCmd(_ cli.Context, cmd *cobra.Command,
clientFactory ClientFactory) *co
dubboctl repo remove [name]
`,
RunE: func(cmd *cobra.Command, args []string) error {
- return nil
+ return runRepo(cmd, args, clientFactory)
},
}
cluster.AddFlags(rc, rootArgs)
addRepoFlags(rc, rArgs)
- rc.AddCommand(newRepoAdd(clientFactory))
- rc.AddCommand(newRepoList(clientFactory))
- rc.AddCommand(newRepoRemove(clientFactory))
+ rc.AddCommand(ad)
+ rc.AddCommand(li)
+ rc.AddCommand(re)
return rc
}
-func runRepo() {
+func runRepo(cmd *cobra.Command, args []string, clientFactory ClientFactory)
error {
+ return nil
+}
+func addCmd(cmd *cobra.Command, clientFactory ClientFactory) *cobra.Command {
+ ac := &cobra.Command{
+ Use: "add",
+ RunE: func(cmd *cobra.Command, args []string) error {
+ return runAdd(cmd, args, clientFactory)
+ },
+ }
+ return ac
}
-func newRepoAdd(clientFactory ClientFactory) *cobra.Command {
+func runAdd(_ *cobra.Command, args []string, clientFactory ClientFactory)
error {
return nil
+}
+func listCmd(cmd *cobra.Command, clientFactory ClientFactory) *cobra.Command {
+ lc := &cobra.Command{
+ Use: "list",
+ Aliases: []string{"ls"},
+ RunE: func(cmd *cobra.Command, args []string) error {
+ return runList(cmd, args, clientFactory)
+ },
+ }
+ return lc
}
-func newRepoList(clientFactory ClientFactory) *cobra.Command {
+func runList(_ *cobra.Command, args []string, clientFactory ClientFactory)
error {
return nil
+}
+func removeCmd(cmd *cobra.Command, clientFactory ClientFactory) *cobra.Command
{
+ rc := &cobra.Command{
+ Use: "remove",
+ RunE: func(cmd *cobra.Command, args []string) error {
+ return runRemove(cmd, args, clientFactory)
+ },
+ }
+ return rc
}
-func newRepoRemove(clientFactory ClientFactory) *cobra.Command {
+func runRemove(_ *cobra.Command, args []string, clientFactory ClientFactory)
error {
return nil
}