MCPcopy Index your code
hub / github.com/dubbogo/tools

github.com/dubbogo/tools @v1.0.10

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.10 ↗ · + Follow
322 symbols 684 edges 77 files 86 documented · 27%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dubbo-go-cli

1. Problem we solved.

For the running dubbo-go server, we need a telnet-cli tool to test if the server works healthily. The tool should support dubbo protocol. It makes it easy for you to define your own request pkg and gets rsp struct of your server, and total costing time.

2. How to get cli-tool

go get -u github.com/dubbogo/tools/cmd/dubbogo-cli

3. How to get dubbo

go get -u github.com/dubbogo/tools/cmd/protoc-gen-dubbo

4. How to get dubbo3

go get -u github.com/dubbogo/tools/cmd/protoc-gen-dubbo3

5. How to get imports-formatter

go get -u github.com/dubbogo/tools/cmd/imports-formatter

6. Quick start:example

imports-formatter

1. Problem we solved.

For simplifying imports, we provider a tool named imports-formatter.it is a tool that help you format the imports of the project. it is easy to use with several commandline arguments.

2. How to get imports-formatter

go get -u github.com/dubbogo/tools/cmd/imports-formatter

3. Quick start

Note: Before use it, you need to set environment variable GOROOT(like export GOROOT=/usr/local/go). take an example of imports-formatter when we try to format the apache/dubbo-go

suppose that we have a go file in this project(github.com/dubbogo/tools) with these imports:

    import (
        "os"
        "github.com/dubbogo/tools/cmd/main"
        "dubbo.apache.org/dubbo-go/v3/config"
        "dubbo.apache.org/dubbo-go/v3/common"
    )

after execution of imports-formatter -path . -module github.com/dubbogo/tools -bl false, it will act like following:

    import (
        "os"
    )

    import (
        "dubbo.apache.org/dubbo-go/v3/common"
        "dubbo.apache.org/dubbo-go/v3/config"
    )

    import (
        "github.com/dubbogo/tools/cmd/main" 
    )

imports-formatter will split illegal format imports to three blocks:

  1. the first import block is some built-in modules/packages in go language.
  2. the second import block is some third party modules/packages.
  3. the third import block is the modules/packages in this module.

now we explain the usage of this tool with above command:

imports-formatter -path . -module github.com/dubbogo/tools -bl false

  • path: the directory that you want to format imports, the default value is current work directory.
  • module: the go module name, you can find it in go.mod of the project. if not set, it will find go.mod in path that you set.
  • bl: in second import block, we may have many third party modules, if bl is true, the tool will split these modules with a blank line. The default value is true.

so you can simplified the above command to imports-formatter -path . -module github.com/dubbogo/tools, and if you execute this command in the project root path, you can even ignore remaining 2 parameter, only need to type imports-formatter on your screen.

Extension points exported contracts — how you extend this code

Task (Interface)
Task 任务 [6 implementers]
cmd/dubbogo-cli/generator/pool.go
Task (Interface)
Task 任务 [6 implementers]
cmd/dubbogo-cli-v2/generator/sample/hessian/pool.go
Protocol (Interface)
(no doc) [2 implementers]
internal/protocol/protocol.go
TestFnType (FuncType)
(no doc)
pkg/tester/stress.go
Adapter (Interface)
(no doc) [2 implementers]
cmd/dubbogo-cli/common/interfaces.go
InstallFactory (Interface)
(no doc) [3 implementers]
cmd/dubbogo-cli-v2/cmd/install.go
TestFnWithErrorType (FuncType)
(no doc)
pkg/tester/stress.go
MetaData (Interface)
MetaData meta data from registration center [1 implementers]
cmd/dubbogo-cli-v2/metadata/metadata.go

Core symbols most depended-on inside this repo

P
called by 311
cmd/protoc-gen-dubbo3grpc/plugin/dubbo/dubbo.go
Name
called by 12
cmd/protoc-gen-dubbo3grpc/plugin/dubbo/dubbo.go
Write
called by 8
internal/protocol/protocol.go
mergeImports
called by 7
cmd/imports-formatter/main.go
showLog
called by 7
cmd/dubbogo-cli/generator/logger.go
refreshImports
called by 6
cmd/imports-formatter/main.go
showLog
called by 6
cmd/dubbogo-cli-v2/generator/sample/hessian/logger.go
Run
called by 5
pkg/tester/stress.go

Shape

Function 145
Method 116
Struct 40
Interface 9
TypeAlias 9
FuncType 3

Languages

Go100%

Modules by API surface

pkg/tester/stress.go21 symbols
cmd/protoc-gen-go-triple/examples/helloworld_triple.pb.go20 symbols
cmd/protoc-gen-go-triple/examples/helloworld.pb.go18 symbols
cmd/dubbogo-cli-v2/cmd/install.go15 symbols
cmd/imports-formatter/main.go14 symbols
cmd/protoc-gen-dubbo3grpc/plugin/dubbo/dubbo.go13 symbols
internal/client/client.go11 symbols
cmd/dubbogo-cli-v2/generator/sample/hessian/generator.go11 symbols
pkg/stressTest/config.go10 symbols
example/server/user.go10 symbols
cmd/protoc-gen-go-triple/triple/triple.go10 symbols
cmd/dubbogo-cli/generator/generator.go10 symbols

For agents

$ claude mcp add tools \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page