This is an automated email from the ASF dual-hosted git repository.
Alanxtl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/develop by this push:
new 0f0ee4c9c docs: complete Triple configuration field comments (#3674)
0f0ee4c9c is described below
commit 0f0ee4c9c0dc48cda032e81d5be78222330a0364
Author: 班尼牛 <[email protected]>
AuthorDate: Thu Aug 20 13:39:00 2026 +0800
docs: complete Triple configuration field comments (#3674)
* docs: complete Triple configuration field comments
Signed-off-by: 班尼牛 <[email protected]>
* style: apply modernize fix to map generalizer test
Signed-off-by: 班尼牛 <[email protected]>
---------
Signed-off-by: 班尼牛 <[email protected]>
---
filter/generic/generalizer/map_test.go | 2 +-
global/http3_config.go | 29 +++++++++++++++++------------
global/protocol_config.go | 18 +++++++++++++-----
global/triple_config.go | 22 ++++++++++++++--------
4 files changed, 45 insertions(+), 26 deletions(-)
diff --git a/filter/generic/generalizer/map_test.go
b/filter/generic/generalizer/map_test.go
index 00e5945eb..cdeaca910 100644
--- a/filter/generic/generalizer/map_test.go
+++ b/filter/generic/generalizer/map_test.go
@@ -88,7 +88,7 @@ func TestMTagRoundTrip(t *testing.T) {
require.True(t, ok)
assert.Equal(t, "42", generalizedMap["user_id"])
- realized, err := mockMapGeneralizer.Realize(generalized,
reflect.TypeOf(original))
+ realized, err := mockMapGeneralizer.Realize(generalized,
reflect.TypeFor[testMTagObj]())
require.NoError(t, err)
assert.Equal(t, original, realized)
}
diff --git a/global/http3_config.go b/global/http3_config.go
index f2a0742ad..c77a8f030 100644
--- a/global/http3_config.go
+++ b/global/http3_config.go
@@ -19,27 +19,32 @@ package global
// Http3Config represents the config of http3 protocol.
type Http3Config struct {
- // Enable defines whether to enable HTTP/3 support.
- // When set to true, both HTTP/2 and HTTP/3 servers will be started
simultaneously.
- // When set to false, only HTTP/2 server will be started.
+ // Enable defines whether HTTP/3 support is enabled for server and
client.
+ // When true, a valid TLS configuration is required; otherwise,
initialization fails.
+ // With valid TLS, server starts both HTTP/2 and HTTP/3,
+ // and client uses a dual HTTP/2 and HTTP/3 transport.
+ // When false, server starts only HTTP/2, and client uses an HTTP/2
transport.
// The default value is false.
Enable bool `yaml:"enable" json:"enable,omitempty"`
- // Negotiation defines whether to enable HTTP/3 negotiation.
- // If set to true, HTTP/2 alt-svc negotiation will be enabled,
+
+ // Negotiation defines whether HTTP/3 negotiation is enabled for server.
+ // When true, HTTP/3 is advertised through Alt-Svc,
// allowing clients to negotiate between HTTP/2 and HTTP/3.
- // If set to false, HTTP/2 alt-svc negotiation will be skipped,
- // Clients cannot discover HTTP/3 via Alt-Svc.
+ // When false, HTTP/3 is not advertised through Alt-Svc.
// The default value is true.
- // ref:
https://quic-go.net/docs/http3/server/#advertising-http3-via-alt-svc
+ // For more details, see
https://quic-go.net/docs/http3/server/#advertising-http3-via-alt-svc.
Negotiation bool `yaml:"negotiation" json:"negotiation,omitempty"`
- // KeepAlivePeriod defines how often to send keep-alive packets.
+ // KeepAlivePeriod defines how often keep-alive packets are sent for
server and client.
KeepAlivePeriod string `yaml:"keep-alive-period"
json:"keep-alive-period,omitempty"`
- // MaxIdleTimeout defines the maximum idle timeout for QUIC connections.
+
+ // MaxIdleTimeout defines the maximum idle timeout for QUIC connections
on server and client.
MaxIdleTimeout string `yaml:"max-idle-timeout"
json:"max-idle-timeout,omitempty"`
- // MaxIncomingStreams defines the maximum number of concurrent
bidirectional streams.
+
+ // MaxIncomingStreams defines the maximum number of concurrent
bidirectional streams accepted by server and client.
MaxIncomingStreams int64 `yaml:"max-incoming-streams"
json:"max-incoming-streams,omitempty"`
- // MaxIncomingUniStreams defines the maximum number of concurrent
unidirectional streams.
+
+ // MaxIncomingUniStreams defines the maximum number of concurrent
unidirectional streams accepted by server and client.
MaxIncomingUniStreams int64 `yaml:"max-incoming-uni-streams"
json:"max-incoming-uni-streams,omitempty"`
}
diff --git a/global/protocol_config.go b/global/protocol_config.go
index 1eec6612e..5316e4424 100644
--- a/global/protocol_config.go
+++ b/global/protocol_config.go
@@ -23,26 +23,34 @@ import (
// ProtocolConfig represents the config of protocol.
type ProtocolConfig struct {
+ // Name defines the protocol name for server.
Name string `yaml:"name" json:"name,omitempty" property:"name"`
- Ip string `yaml:"ip" json:"ip,omitempty" property:"ip"`
+
+ // Ip defines the listening IP address for server.
+ Ip string `yaml:"ip" json:"ip,omitempty" property:"ip"`
+
+ // Port defines the listening port for server.
Port string `yaml:"port" json:"port,omitempty" property:"port"`
// TODO: maybe Params is useless, find a ideal way to config dubbo
protocol, ref: TripleConfig.
+ // Params defines additional protocol parameters for server.
Params any `yaml:"params" json:"params,omitempty" property:"params"`
- // TripleConfig holds the Triple protocol configuration.
+ // TripleConfig holds the Triple protocol configuration for server.
TripleConfig *TripleConfig `yaml:"triple" json:"triple,omitempty"
property:"triple"`
// TODO: remove MaxServerSendMsgSize and MaxServerRecvMsgSize when
version 4.0.0
//
- // MaxServerSendMsgSize defines the max size of server send message,
1mb=1000kb=1000000b 1mib=1024kb=1048576b.
- // more detail to see
https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants
+ // MaxServerSendMsgSize defines the maximum size of messages sent by
server.
+ // Supported units include 1mb=1000kb=1000000b and 1mib=1024kb=1048576b.
+ // For more details, see
https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants.
//
// Deprecated: use
"ClientProtocolConfig.TripleConfig.MaxServerSendMsgSize" or in config tag
"protocol_config/triple/max-server-send-msg-size" instead
MaxServerSendMsgSize string `yaml:"max-server-send-msg-size"
json:"max-server-send-msg-size,omitempty"`
+
// TODO: remove MaxServerSendMsgSize and MaxServerRecvMsgSize when
version 4.0.0
//
- // MaxServerRecvMsgSize defines the max size of server receive message.
+ // MaxServerRecvMsgSize defines the maximum size of messages received
by server.
//
// Deprecated: use
"ClientProtocolConfig.TripleConfig.MaxServerRecvMsgSize" or in config tag
"protocol_config/triple/max-server-recv-msg-size" instead
MaxServerRecvMsgSize string `default:"4mib"
yaml:"max-server-recv-msg-size" json:"max-server-recv-msg-size,omitempty"`
diff --git a/global/triple_config.go b/global/triple_config.go
index 1bd620b9b..25bdf6314 100644
--- a/global/triple_config.go
+++ b/global/triple_config.go
@@ -24,24 +24,30 @@ type TripleConfig struct {
//
// for server
//
- // MaxServerSendMsgSize defines the max size of server send message,
1mb=1000kb=1000000b 1mib=1024kb=1048576b.
- // more detail to see
https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants
+ // MaxServerSendMsgSize defines the maximum size of messages sent by
server.
+ // Supported units include 1mb=1000kb=1000000b and 1mib=1024kb=1048576b.
+ // For more details, see
https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants.
MaxServerSendMsgSize string `yaml:"max-server-send-msg-size"
json:"max-server-send-msg-size,omitempty"`
- // MaxServerRecvMsgSize defines the max size of server receive message.
+
+ // MaxServerRecvMsgSize defines the maximum size of messages received
by server.
MaxServerRecvMsgSize string `yaml:"max-server-recv-msg-size"
json:"max-server-recv-msg-size,omitempty"`
- // Http3 holds the HTTP/3 transport configuration.
+
+ // Http3 holds the HTTP/3 transport configuration for server and client.
Http3 *Http3Config `yaml:"http3" json:"http3,omitempty"`
- // Cors configures CORS for Triple protocol handlers.
+
+ // Cors configures CORS for Triple protocol handlers on server.
Cors *CorsConfig `yaml:"cors" json:"cors,omitempty"`
- // OpenAPI configures OpenAPI documentation generation.
+
+ // OpenAPI configures OpenAPI documentation generation for server.
OpenAPI *OpenAPIConfig `yaml:"openapi" json:"openapi,omitempty"`
//
// for client
//
- // KeepAliveInterval defines the duration of keep alive interval.
+ // KeepAliveInterval defines the keep-alive interval for client.
KeepAliveInterval string `yaml:"keep-alive-interval"
json:"keep-alive-interval,omitempty" property:"keep-alive-interval"`
- // KeepAliveTimeout defines the duration of keep alive timeout.
+
+ // KeepAliveTimeout defines the keep-alive timeout for client.
KeepAliveTimeout string `yaml:"keep-alive-timeout"
json:"keep-alive-timeout,omitempty" property:"keep-alive-timeout"`
}