blob: 982c621aa67b9e3e8551e436fedc7004e0d3a76f [file] [log] [blame]
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Apache Dubbo – Reference</title><link>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/</link><description>Recent content in Reference on Apache Dubbo</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs3-V2: configuration item reference</title><link>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/config/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/config/</guid><description>
&lt;h2 id="root-configuration">root configuration&lt;/h2>
&lt;h2 id="client-configuration">Client configuration&lt;/h2>
&lt;h2 id="server-configuration">Server configuration&lt;/h2>
&lt;h2 id="registry-configuration">Registry configuration&lt;/h2>
&lt;h3 id="using-the-configuration-api">Using the Configuration API&lt;/h3>
&lt;ul>
&lt;li>The client sets up the registry using the configuration API&lt;/li>
&lt;/ul>
&lt;p>You can quickly set the registry for debugging by calling the config.NewRegistryConfigWithProtocolDefaultPort method, and support zookeeper(127.0.0.1:2181) and nacos(127.0.0.1:8848)&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>rc &lt;span style="color:#719e07">:=&lt;/span> config. &lt;span style="color:#268bd2">NewRootConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetConsumer&lt;/span>(config. &lt;span style="color:#268bd2">NewConsumerConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetRegistryIDs&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;zookeeperID&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// use defined registryID
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddRegistry&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;zookeeperID&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewRegistryConfigWithProtocolDefaultPort&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;zookeeper&amp;#34;&lt;/span>)).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>All interfaces: can be configured by calling the rich interfaces provided by RegistryConfigBuilder.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>rc &lt;span style="color:#719e07">:=&lt;/span> config. &lt;span style="color:#268bd2">NewRootConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetConsumer&lt;/span>(config. &lt;span style="color:#268bd2">NewConsumerConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetRegistryIDs&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;nacosRegistryID&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// use defined registryID
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">AddReference&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;GreeterClientImpl&amp;#34;&lt;/span>, &lt;span style="color:#586e75">/*...*/&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddRegistry&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;nacosRegistryID&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewRegistryConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProtocol&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;nacos&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetAddress&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;127.0.0.1:8848&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetGroup&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;dubbo-go&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetNamespace&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;dubbo&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetUsername&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;admin&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetPassword&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;admin&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetTimeout&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;3s&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>The server uses the configuration API to set the configuration center&lt;/li>
&lt;/ul>
&lt;p>Simple interface config.NewRegistryConfigWithProtocolDefaultPort&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>rc &lt;span style="color:#719e07">:=&lt;/span> config. &lt;span style="color:#268bd2">NewRootConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProvider&lt;/span>(config. &lt;span style="color:#268bd2">NewProviderConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddService&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;GreeterProvider&amp;#34;&lt;/span>, &lt;span style="color:#586e75">/*...*/&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetRegistryIDs&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;registryKey&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// use defined registryIDs
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddRegistry&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;registryKey&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewRegistryConfigWithProtocolDefaultPort&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;zookeeper&amp;#34;&lt;/span>)).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>All interfaces: can be configured by calling the rich interfaces provided by RegistryConfigBuilder.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>rc &lt;span style="color:#719e07">:=&lt;/span> config. &lt;span style="color:#268bd2">NewRootConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProvider&lt;/span>(config. &lt;span style="color:#268bd2">NewProviderConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddService&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;GreeterProvider&amp;#34;&lt;/span>, &lt;span style="color:#586e75">/*...*/&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetRegistryIDs&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;registryKey&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// use defined registryIDs
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddRegistry&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;registryKey&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewRegistryConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProtocol&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;nacos&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetAddress&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;127.0.0.1:8848&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetGroup&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;dubbo-go&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetNamespace&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;dubbo&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetUsername&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;admin&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetPassword&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;admin&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetTimeout&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;3s&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="heading">&lt;/h3>
&lt;h2 id="network-protocol">Network protocol&lt;/h2>
&lt;h3 id="configuration-file">configuration file&lt;/h3>
&lt;h3 id="using-the-configuration-api-1">Using the Configuration API&lt;/h3>
&lt;ul>
&lt;li>The client sets the network protocol using the configuration API&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>rc &lt;span style="color:#719e07">:=&lt;/span> config. &lt;span style="color:#268bd2">NewRootConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetConsumer&lt;/span>(config. &lt;span style="color:#268bd2">NewConsumerConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddReference&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;GreeterClientImpl&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewReferenceConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetInterface&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;org. apache. dubbo. UserProvider&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProtocol&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;tri&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// set reference protocol to triple
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>The server uses the configuration API to set the network protocol&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>rc &lt;span style="color:#719e07">:=&lt;/span> config. &lt;span style="color:#268bd2">NewRootConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProvider&lt;/span>(config. &lt;span style="color:#268bd2">NewProviderConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddService&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;GreeterProvider&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewServiceConfigBuilder&lt;/span>().
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetInterface&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;org. apache. dubbo. UserProvider&amp;#34;&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">SetProtocolIDs&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;tripleProtocolKey&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// use protocolID &amp;#39;tripleProtocolKey&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">AddProtocol&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;tripleProtocolKey&amp;#34;&lt;/span>, config. &lt;span style="color:#268bd2">NewProtocolConfigBuilder&lt;/span>(). &lt;span style="color:#586e75">// define protocol config with protocolID &amp;#39;tripleProtocolKey&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">SetName&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;tri&amp;#34;&lt;/span>). &lt;span style="color:#586e75">// set service protocol to triple
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span> &lt;span style="color:#268bd2">Build&lt;/span>()).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#268bd2">build&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="heading-1">&lt;/h3></description></item><item><title>Docs3-V2: Use dubbogo-cli tool</title><link>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/use_dubbogo_cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/use_dubbogo_cli/</guid><description>
&lt;h2 id="1-installation">1. Installation&lt;/h2>
&lt;p>dubbogo-cli is a sub-project of the Apache/dubbo-go ecosystem, which provides developers with convenient functions such as application template creation, tool installation, and interface debugging to improve user R&amp;amp;D efficiency.&lt;/p>
&lt;p>Execute the following command to install dubbogo-cli to $GOPATH/bin&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>go install github.com/dubbogo/dubbogo-cli@latest
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="2-function-overview">2. Function overview&lt;/h2>
&lt;p>dubbogo-cli supports the following capabilities&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Application template creation&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>dubbogo-cli newApp.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Create an application template in the current directory&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Demo creation&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>dubbogo-cli newDemo.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Create an RPC example in the current directory, including a client and a server&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Compile and debug tool installation&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>dubbogo-cli install all
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>One-click installation of the following tools to $GOPATH/bin&lt;/p>
&lt;p>-protoc-gen-go-triple&lt;/p>
&lt;pre>&lt;code>Compilation for triple protocol interface
&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>
&lt;p>imports-formatter&lt;/p>
&lt;p>Used to tidy up code import blocks.&lt;/p>
&lt;p>&lt;a href="https://github.com/dubbogo/tools#imports-formatter">import-formatte README&lt;/a>&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>View dubbo-go application registration information&lt;/p>
&lt;ul>
&lt;li>
&lt;p>View the registration information on Zookeeper to get a list of interfaces and methods&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>$ dubbogo-cli show --r zookeeper --h 127.0.0.1:2181
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>interface: com.dubbogo.pixiu.UserService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>methods: &lt;span style="color:#719e07">[&lt;/span>CreateUser, GetUserByCode, GetUserByName, GetUserByNameAndAge, GetUserTimeout, UpdateUser, UpdateUserByName&lt;span style="color:#719e07">]&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>View the registration information on Nacos [function under development]&lt;/p>
&lt;/li>
&lt;li>
&lt;p>View the registration information of Istio [function under development]&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Debug Dubbo protocol interface&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Debug Triple protocol interface&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="3-function-details">3. Function details&lt;/h2>
&lt;h3 id="31-demo-application-introduction">3.1 Demo application introduction&lt;/h3>
&lt;h4 id="311-demo-creation">3.1.1 Demo Creation&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>dubbogo-cli newDemo.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Create a demo in the current directory, including the client and server. The demo shows the completion of an RPC call based on a set of interfaces.&lt;/p>
&lt;p>The Demo uses the direct connection mode without relying on the registration center. The server side exposes the service to the local port 20000, and the client initiates the call.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── api
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── samples_api.pb.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── samples_api.proto
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── samples_api_triple.pb.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── go-client
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── cmd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── client.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── conf
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── dubbogo.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── go-server
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── cmd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── server.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── conf
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── dubbogo.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>└── go.mod
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="312-running-demo">3.1.2 Running Demo&lt;/h4>
&lt;p>Start the server&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>$ cd go-server/cmd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ go run .
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Another terminal opens the client&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>$ go mod tidy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ cd go-client/cmd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ go run .
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can see the print log&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>INFO cmd/client.go:49 client response result: name:&amp;#34;Hello laurence&amp;#34; id:&amp;#34;12345&amp;#34; age:21
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="32-application-template-introduction">3.2 Application template introduction&lt;/h3>
&lt;h4 id="321-application-template-creation">3.2.1 Application template creation&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>dubbogo-cli newApp.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Create an application template in the current directory:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── Makefile
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── api
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── api.pb.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── api.proto
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── api_triple.pb.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├──build
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── Dockerfile
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── chart
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── app
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Chart.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── templates
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ │ ├── _helpers.tpl
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ │ ├── deployment.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ │ ├── service.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ │ └── serviceaccount.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── values.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── nacos_env
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── Chart.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── templates
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── _helpers.tpl
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── deployment.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── service.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── values.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── cmd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── app.go
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── conf
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── dubbogo.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── go.mod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── go.sum
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>└── pkg
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> └── service
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> └── service.go
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="322-application-template-introduction">3.2.2 Application template introduction&lt;/h4>
&lt;p>The generated project includes several directories:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>api: place interface files: proto file and generated .pb.go file&lt;/p>
&lt;/li>
&lt;li>
&lt;p>build: place mirror build related files&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Chart: place the chart warehouse for publishing, the basic environment chart warehouse: nacos, mesh (under development)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>cmd: program entry&lt;/p>
&lt;/li>
&lt;li>
&lt;p>conf: framework configuration&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pkg/service: RPC service implementation&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Makefile:&lt;/p>
&lt;/li>
&lt;li>
&lt;ul>
&lt;li>Image, helm deployment name:&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;ul>
&lt;li>
&lt;ul>
&lt;li>IMAGE = $(your_repo)/$(namespace)/$(image_name)
TAG = 1.0.0&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>HELM_INSTALL_NAME = dubbo-go-app, helm installation name, used for helm install/uninstall command.&lt;/p>
&lt;/li>
&lt;li>
&lt;ul>
&lt;li>Provide scripts such as:&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;ul>
&lt;li>
&lt;ul>
&lt;li>make build # Package the image and push it&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>make buildx-publish # The arm architecture locally packs the amd64 image and pushes it, relying on docker buildx&lt;/p>
&lt;/li>
&lt;li>
&lt;p>make deploy # Publish the application through helm&lt;/p>
&lt;/li>
&lt;li>
&lt;p>make remove # Delete the published helm application&lt;/p>
&lt;/li>
&lt;li>
&lt;p>make proto-gen # generate pb.go file under api&lt;/p>
&lt;/li>
&lt;li>&lt;/li>
&lt;/ul>
&lt;p>Development process using application templates&lt;/p>
&lt;blockquote>
&lt;p>Dependent environment: make, go, helm, kubectl, docker&lt;/p>
&lt;/blockquote>
&lt;ol>
&lt;li>Generate a template through dubbogo-cli&lt;/li>
&lt;li>Modify api/api.proto&lt;/li>
&lt;li>make proto-gen&lt;/li>
&lt;li>Development interface&lt;/li>
&lt;li>Modify the image name of IMAGE and release name of HELM_INSTALL_NAME in the makefile&lt;/li>
&lt;li>Make a mirror image and push&lt;/li>
&lt;li>Modify the value configuration related to deployment in chart/app/values, focusing on the image part.&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>image:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> repository: $(your_repo)/$(namespace)/$(image_name)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> pullPolicy: Always
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> tag: &amp;#34;1.0.0&amp;#34;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="8">
&lt;li>make deploy, use helm to publish the application.&lt;/li>
&lt;/ol>
&lt;h3 id="33-debug-dubbo-go-application-with-grpc-protocol">3.3 Debug dubbo-go application with gRPC protocol&lt;/h3>
&lt;h4 id="331-introduction">3.3.1 Introduction&lt;/h4>
&lt;p>The grpc_cli tool is a tool used by the gRPC ecosystem to debug services. It can be obtained under the premise that [reflection service] (&lt;a href="https://github.com/grpc/grpc/blob/master/doc/server-reflection.md">https://github.com/grpc/grpc/blob/master/doc/server-reflection.md&lt;/a>) is enabled on the server Go to the service&amp;rsquo;s proto file, service name, method name, parameter list, and initiate a gRPC call.&lt;/p>
&lt;p>The Triple protocol is compatible with the gRPC ecosystem, and the gRPC reflection service is enabled by default, so you can directly use grpc_cli to debug the triple service.&lt;/p>
&lt;h4 id="332-install-grpc_cli">3.3.2 Install grpc_cli&lt;/h4>
&lt;blockquote>
&lt;p>Subsequent installation will be done by dubbogo-cli, currently users need to install manually&lt;/p>
&lt;/blockquote>
&lt;p>Refer to &lt;a href="https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md">grpc_cli documentation&lt;/a>&lt;/p>
&lt;h4 id="333-use-grpc_cli-to-debug-triple-service">3.3.3 Use grpc_cli to debug Triple service&lt;/h4>
&lt;ol>
&lt;li>View the interface definition of the triple service&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ grpc_cli ls localhost:20001 -l
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>filename: helloworld.proto
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>package: org.apache.dubbo.quickstart.samples;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>service UserProvider &lt;span style="color:#719e07">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> rpc SayHello&lt;span style="color:#719e07">(&lt;/span>org.apache.dubbo.quickstart.samples.HelloRequest&lt;span style="color:#719e07">)&lt;/span> returns &lt;span style="color:#719e07">(&lt;/span>org.apache.dubbo.quickstart.samples.User&lt;span style="color:#719e07">)&lt;/span> &lt;span style="color:#719e07">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> rpc SayHelloStream&lt;span style="color:#719e07">(&lt;/span>stream org.apache.dubbo.quickstart.samples.HelloRequest&lt;span style="color:#719e07">)&lt;/span> returns &lt;span style="color:#719e07">(&lt;/span>stream org.apache.dubbo.quickstart.samples.User&lt;span style="color:#719e07">)&lt;/span> &lt;span style="color:#719e07">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#719e07">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="2">
&lt;li>Check the request parameter type&lt;/li>
&lt;/ol>
&lt;p>For example, if a developer wants to test the SayHello method of the above port, and tries to obtain the specific definition of HelloRequest, he needs to execute the following command to view the definition of the corresponding parameters.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ grpc_cli &lt;span style="color:#b58900">type&lt;/span> localhost:20001 org.apache.dubbo.quickstart.samples.HelloRequest
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>message HelloRequest &lt;span style="color:#719e07">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> string &lt;span style="color:#268bd2">name&lt;/span> &lt;span style="color:#719e07">=&lt;/span> &lt;span style="color:#2aa198">1&lt;/span> &lt;span style="color:#719e07">[&lt;/span>&lt;span style="color:#268bd2">json_name&lt;/span> &lt;span style="color:#719e07">=&lt;/span> &lt;span style="color:#2aa198">&amp;#34;name&amp;#34;&lt;/span>&lt;span style="color:#719e07">]&lt;/span>;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#719e07">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="3">
&lt;li>Request interface&lt;/li>
&lt;/ol>
&lt;p>Knowing the specific type of the request parameter, you can initiate a call to test the corresponding service. Check to see if the return value is as expected.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ grpc_cli call localhost:20001 SayHello &lt;span style="color:#2aa198">&amp;#34;name: &amp;#39;laurence&amp;#39;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>connecting to localhost:20001
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>name: &lt;span style="color:#2aa198">&amp;#34;Hello Laurence&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>id: &lt;span style="color:#2aa198">&amp;#34;12345&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>age: &lt;span style="color:#2aa198">21&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Received trailing metadata from server:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>accept-encoding: identity, gzip
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>adaptive-service.inflight : &lt;span style="color:#2aa198">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>adaptive-service. remaining : &lt;span style="color:#2aa198">50&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>grpc-accept-encoding : identity,deflate,gzip
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Rpc succeeded with OK status
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="34-debug-dubbo-go-application-with-dubbo-protocol">3.4 Debug dubbo-go application with Dubbo protocol&lt;/h3>
&lt;h4 id="341-open-dubbo-server">3.4.1 Open Dubbo server&lt;/h4>
&lt;p>Example: user.go:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>func (u *UserProvider) GetUser(ctx context.Context, userStruct *CallUserStruct) (*User, error) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>fmt.Printf(&amp;#34;=========================\nreq:%#v\n&amp;#34;, userStruct)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rsp := User{&amp;#34;A002&amp;#34;, &amp;#34;Alex Stocks&amp;#34;, 18, userStruct.SubInfo}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>fmt.Printf(&amp;#34;========================\nrsp:%#v\n&amp;#34;, rsp)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>return &amp;amp;rsp, nil
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The server opens a service named GetUser, passes in a CallUserStruct parameter, and returns a User parameter
CallUserStruct parameter definition:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>type CallUserStruct struct {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ID string
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Male bool
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SubInfo SubInfo // nested substructure
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>func (cs CallUserStruct) JavaClassName() string {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>return &amp;#34;com.ikurento.user.CallUserStruct&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>type SubInfo struct {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SubID string
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SubMale bool
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SubAge int
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>func (s SubInfo) JavaClassName() string {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>return &amp;#34;com.ikurento.user.SubInfo&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>User structure definition:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>type User struct {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Id string
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>name string
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Age int32
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SubInfo SubInfo // Nest the above substructure SubInfo
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>func (u *User) JavaClassName() string {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>return &amp;#34;com.ikurento.user.User&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Start the service:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>cd server`
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>`source builddev.sh`
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>`go run.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="342-define-request-body-adapted-to-serialization-protocol">3.4.2 Define request body (adapted to serialization protocol)&lt;/h4>
&lt;p>The request body is defined as a json file, and the agreed key value is string
The key corresponds to the field name of the Go language struct, such as &amp;ldquo;ID&amp;rdquo; and &amp;ldquo;Name&amp;rdquo;, and the value corresponds to &amp;ldquo;type@val&amp;rdquo;
Among them, type supports string int bool time, and val is initialized with string. If only type is filled in, it will be initialized to a zero value. It is agreed that each struct must have a JavaClassName field, which must strictly correspond to the server side&lt;/p>
&lt;p>See userCall.json:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;ID&amp;#34;: &amp;#34;string@A000&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;Male&amp;#34;: &amp;#34;bool@true&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubInfo&amp;#34;: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubID&amp;#34;: &amp;#34;string@A001&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubMale&amp;#34;: &amp;#34;bool@false&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubAge&amp;#34;: &amp;#34;int@18&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;JavaClassName&amp;#34;: &amp;#34;string@com.ikurento.user.SubInfo&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;JavaClassName&amp;#34;: &amp;#34;string@com.ikurento.user.CallUserStruct&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>userCall.json defines the structure of the parameter CallUserStruct and the substructure SubInfo, and assigns values to the request parameters.&lt;/p>
&lt;p>Similarly, user.json does not need to assign an initial value as the return value, but the JavaClassName field must strictly correspond to the server side&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;ID&amp;#34;: &amp;#34;string&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;Name&amp;#34;: &amp;#34;string&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;Age&amp;#34;: &amp;#34;int&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;JavaClassName&amp;#34;: &amp;#34;string@com.ikurento.user.User&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubInfo&amp;#34;: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubID&amp;#34;: &amp;#34;string&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubMale&amp;#34;: &amp;#34;bool&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;SubAge&amp;#34;: &amp;#34;int&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;JavaClassName&amp;#34;: &amp;#34;string@com.ikurento.user.SubInfo&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="343-debug-port">3.4.3 Debug port&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>./dubbo-go-cli -h=localhost -p=20001 -proto=dubbo -i=com.ikurento.user.UserProvider -method=GetUser -sendObj=&amp;#34;./userCall.json&amp;#34; -recvObj=&amp;#34;./user .json&amp;#34;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Print result:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 Created pkg:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 &amp;amp;{ID:A000 Male:true SubInfo:0xc00006ea20 JavaClassName:com.ikurento.user.CallUserStruct}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 SubInfo:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 &amp;amp;{SubID:A001 SubMale:false SubAge:18 JavaClassName:com.ikurento.user.SubInfo}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 Created pkg:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 &amp;amp;{ID: Name: Age:0 JavaClassName:com.ikurento.user.User SubInfo:0xc00006ec90}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 SubInfo:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 &amp;amp;{SubID: SubMale:false SubAge:0 JavaClassName:com.ikurento.user.SubInfo}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 connected to localhost:20001!
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 try calling interface: com.ikurento.user.UserProvider.GetUser
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 with protocol: dubbo
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 After 3ms , Got Rsp:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 &amp;amp;{ID:A002 Name:Alex Stocks Age:18 JavaClassName: SubInfo:0xc0001241b0}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 SubInfo:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2020/10/26 20:47:45 &amp;amp;{SubID:A001 SubMale:false SubAge:18 JavaClassName:}```
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can see the detailed request body assignment, as well as the returned result and time-consuming. Supports nested structures&lt;/p>
&lt;p>Print the result on the server side&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>=========================
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>req:&amp;amp;main.CallUserStruct{ID:&amp;#34;A000&amp;#34;, Male:true, SubInfo:main.SubInfo{SubID:&amp;#34;A001&amp;#34;, SubMale:false, SubAge:18}}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>=========================
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>It can be seen that the data from the cli has been received&lt;/p></description></item><item><title>Docs3-V2: Dubbogo Ecological Components</title><link>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/ecology/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/ecology/</guid><description>
&lt;h3 id="dubbo-go--dubbo-go-30">Dubbo-go / Dubbo-go 3.0&lt;/h3>
&lt;p>&lt;a href="https://github.com/apache/dubbo-go">github.com/apache/dubbo-go&lt;/a>&lt;/p>
&lt;p>Apache Dubbo is implemented in Go language, which bridges between Java and Golang.&lt;/p>
&lt;h3 id="dubbo-go-pixiu">Dubbo-go-pixiu&lt;/h3>
&lt;p>&lt;a href="https://github.com/apache/dubbo-go-pixiu">github.com/apache/dubbo-go-pixiu&lt;/a>&lt;/p>
&lt;p>dubbo-go-pixiu gateway supports calling dubbo/dubbo-go clusters with dubbo protocol and http protocol&lt;/p>
&lt;h3 id="dubbo-getty">Dubbo-getty&lt;/h3>
&lt;p>&lt;a href="https://github.com/apache/dubbo-getty">github.com/apache/dubbo-getty&lt;/a>&lt;/p>
&lt;p>dubbo-getty is an asynchronous network io library in Go language that supports tcp/udp/websocket protocols.&lt;/p>
&lt;h3 id="dubbo-go-hessian2">Dubbo-go-hessian2&lt;/h3>
&lt;p>&lt;a href="https://github.com/apache/dubbo-go-hessian2">github.com/apache/dubbo-go-hessian2&lt;/a>&lt;/p>
&lt;p>Dubbo-go-hessian2 is a Go language hessian2 serialization protocol library&lt;/p>
&lt;h3 id="dubbogo-tools">Dubbogo-tools&lt;/h3>
&lt;p>&lt;a href="https://github.com/dubbogo/tools">github.com/dubbogo/tools&lt;/a>&lt;/p>
&lt;p>Dubbogo-tools includes&lt;/p>
&lt;ul>
&lt;li>dubbo-cli tool&lt;/li>
&lt;li>imports-formatter Go language imports block formatter&lt;/li>
&lt;li>protoc-gen-triple PB compilation plugin&lt;/li>
&lt;li>protoc-gen-dubbo3grpc PB compilation plugin&lt;/li>
&lt;/ul>
&lt;h3 id="triple-go">Triple-go&lt;/h3>
&lt;p>&lt;a href="https://github.com/dubbogo/triple">github.com/dubbogo/triple&lt;/a>&lt;/p>
&lt;p>Triple-go is a Triple (Dubbo3) network protocol library implemented in Go language, based on HTTP2 protocol.&lt;/p></description></item><item><title>Docs3-V2: Depends on the adaptation version number</title><link>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/compatible_version/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/compatible_version/</guid><description>
&lt;p>When Dubbo-go releases a new version, update the version it currently depends on.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align:center">Dependency&lt;/th>
&lt;th>Dubbo-go&lt;/th>
&lt;th>Triple&lt;/th>
&lt;th>protoc-gen-go-triple&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align:center">&lt;/td>
&lt;td>v3.0.1&lt;/td>
&lt;td>v1.1.8&lt;/td>
&lt;td>v1.0.8&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:center">&lt;/td>
&lt;td>v3.0.0&lt;/td>
&lt;td>v1.1.6&lt;/td>
&lt;td>v1.0.5&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:center">&lt;/td>
&lt;td>v3.0.0-rc4-1&lt;/td>
&lt;td>v1.1.3&lt;/td>
&lt;td>v1.0.2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:center">&lt;/td>
&lt;td>v3.0.0-rc3&lt;/td>
&lt;td>v1.0.9&lt;/td>
&lt;td>v1.0.0&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table></description></item><item><title>Docs3-V2: Basic concepts of configuration</title><link>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/basic_concept/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dubbo.apache.org/en/docs3-v2/golang-sdk/refer/basic_concept/</guid><description>
&lt;h2 id="1-framework-configuration">1. Framework configuration&lt;/h2>
&lt;p>The Dubbo-go framework needs to rely on configuration to start. Configuration contains the various capabilities that a developer wishes to use with the framework.&lt;/p>
&lt;h3 id="configuration-format">Configuration format&lt;/h3>
&lt;p>yaml&lt;/p>
&lt;h3 id="configuration-path">Configuration path&lt;/h3>
&lt;p>Load framework configuration from &lt;code>../conf/dubbogo.yaml&lt;/code> by default&lt;/p>
&lt;p>You can modify the configuration file path by specifying the environment variable: DUBBO_GO_CONFIG_PATH=$(your_config_path)/dubbogo.yaml.&lt;/p>
&lt;h3 id="configure-the-root-structure">Configure the root structure&lt;/h3>
&lt;p>Located at &lt;a href="https://github.com/apache/dubbo-go/blob/e00cf8d6fb2be3cd9c6e42cc3d6efa54e10229d3/config/root_config.go#L50">dubbo.apache.org/dubbo-go/v3/config/root_config.go: RootConfig&lt;/a>&lt;/p>
&lt;p>When the framework is loaded, any form of configuration will be parsed into RootConfig and loaded in the RootConfig.Init method.&lt;/p>
&lt;h2 id="2-configuration-api">2. Configuration API&lt;/h2>
&lt;p>Developers can start the framework by building configurations in the form of an API. This method is more suitable for the situation where dubbo-go is introduced as a third-party component.&lt;/p>
&lt;h2 id="3-configuration-center">3. Configuration Center&lt;/h2>
&lt;p>Developers can place configurations in the configuration center to facilitate configuration management and modification.&lt;/p></description></item></channel></rss>