This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch refactor-with-go-components-experimental
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git

commit 7d2ba2451b386e95155a5487378a86f908f7effe
Author: chickenlj <[email protected]>
AuthorDate: Mon Jul 3 11:42:45 2023 +0800

    update README.md
---
 cmd/admin/README.md      | 39 +++------------------------------------
 cmd/admin/cmd/auth.go    | 33 +++++++++++++++++++++++++++++++++
 cmd/admin/cmd/console.go | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 69 insertions(+), 36 deletions(-)

diff --git a/cmd/admin/README.md b/cmd/admin/README.md
index e4199f9a..cd72a9d2 100644
--- a/cmd/admin/README.md
+++ b/cmd/admin/README.md
@@ -1,38 +1,5 @@
 # 运行 Admin
-## 启动 Zookeeper
-首先,你需要在本地启动一个 [zookeeper 
server](https://zookeeper.apache.org/doc/current/zookeeperStarted.html),用作 
Admin 连接的注册/配置中心。
 
-## 启动 Admin
-
-### Run with IDE
-Once open this project in GoLand, a pre-configured Admin runnable task can be 
found from "Run Configuration" pop up menu as shown below.
-
-![image.png](../../docs/images/ide_configuration.png)
-
-Click the `Run` button and you can get the Admin process started locally. 
-
-> But before doing that, you might need to change the configuration file 
located at `/conf/dubboadmin.yml` to make sure `registry.address` is pointed to 
the zookeeper server you started before.
-
-```yaml
-admin:
-  registry:
-    address: zookeeper://127.0.0.1:2181
-  config-center: zookeeper://127.0.0.1:2181
-  metadata-report:
-    address: zookeeper://127.0.0.1:2181
-```
-
-### Run with command line 
-```shell
-$ export ADMIN_CONFIG_PATH=/path/to/your/admin/project/conf/admin.yml
-$ cd cmd/admin
-$ go run . 
-```
-
-> If you also have the Java version admin running, make sure to use different 
port to avoid conflict.
-
-## 启动示例
-为了能在 Admin 控制台看到一些示例数据,可以在本地启动一些示例项目。可参考以下两个链接,务必确保示例使用的注册中心指向你之前启动的 zookeeper 
server,如果示例中有使用 embeded zookeeper 则应该进行修改并指向你本地起的 zookeeper 集群。
-
-1. 
https://github.com/apache/dubbo-samples/tree/master/1-basic/dubbo-samples-spring-boot
-2. https://dubbo.apache.org/zh-cn/overview/quickstart/java/brief/
\ No newline at end of file
+* `dubbo-admin run` 启动 Dubbo Admin,包含所有能力
+* `dubbo-admin auth` 只启动 Dubbo Admin auth server
+* `dubbo-admin console` 只启动 Dubbo Admin console
\ No newline at end of file
diff --git a/cmd/admin/cmd/auth.go b/cmd/admin/cmd/auth.go
new file mode 100755
index 00000000..0ac2af1f
--- /dev/null
+++ b/cmd/admin/cmd/auth.go
@@ -0,0 +1,33 @@
+package cmd
+
+import (
+       "github.com/apache/dubbo-admin/pkg/core/cmd"
+       "github.com/apache/dubbo-admin/pkg/logger"
+
+       "github.com/spf13/cobra"
+)
+
+func newAuthCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command {
+       args := struct {
+               configPath string
+       }{}
+
+       cmd := &cobra.Command{
+               Use:   "auth",
+               Short: "Launch Dubbo Admin auth server.",
+               Long:  `Launch Dubbo Admin auth server.`,
+               RunE: func(cmd *cobra.Command, _ []string) error {
+                       // start CA
+                       if err := startCA(cmd); err != nil {
+                               logger.Error("Failed to start auth server.")
+                               return err
+                       }
+                       return nil
+               },
+       }
+
+       // flags
+       cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", 
"", "configuration file")
+
+       return cmd
+}
diff --git a/cmd/admin/cmd/console.go b/cmd/admin/cmd/console.go
new file mode 100755
index 00000000..f41594d6
--- /dev/null
+++ b/cmd/admin/cmd/console.go
@@ -0,0 +1,33 @@
+package cmd
+
+import (
+       "github.com/apache/dubbo-admin/pkg/core/cmd"
+       "github.com/apache/dubbo-admin/pkg/logger"
+
+       "github.com/spf13/cobra"
+)
+
+func newConsoleCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command {
+       args := struct {
+               configPath string
+       }{}
+
+       cmd := &cobra.Command{
+               Use:   "auth",
+               Short: "Launch Dubbo Admin console server.",
+               Long:  `Launch Dubbo Admin console server.`,
+               RunE: func(cmd *cobra.Command, _ []string) error {
+                       // start CA
+                       if err := startCA(cmd); err != nil {
+                               logger.Error("Failed to start auth server.")
+                               return err
+                       }
+                       return nil
+               },
+       }
+
+       // flags
+       cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", 
"", "configuration file")
+
+       return cmd
+}

Reply via email to