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

github.com/dubbogo/triple @v1.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.1 ↗ · + Follow
226 symbols 527 edges 25 files 76 documented · 34% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Triple-go

Dubbo 3.0 协议 (别名: Triple) 的go语言版本。

简介

Triple-go 是一个基于http2协议的go语言协议库,在 Dubbo-go 3.0 中作为全新的feature被使用。

这是一个 grpc 扩展协议库,它与grpc协议互通,并且和 Dubbo-java 的3.0协议完全兼容。

功能

  • 使用标准 proto IDL 定义您的 dubbo-go 服务,并实现与 dubbo-java 跨语言互通。
  • 与您现有的 grpc 服务完美互通,使您体验兼具dubbo服务治理能力 和 grpc兼容性的框架。
  • 提供双向流式 RPC 调用,并与grpc互通。

架构图

triple-go-arch

Triple协议

  • 阿里云官方介绍文章:《Dubbo 3.0 - 开启下一代云原生微服务》

  • Http2协议头扩展字段:

  • 请求头

    tri-service-version: dubbo 应用版本号

    tri-service-group: dubbo 应用 group

    tri-req-id: 请求id

    tri-trace-traceid: trace id

    tri-trace-rpcid: span id

    tri-trace-proto-bin: trace上下文二进制信息

    tri-unit-info: 集群信息

  • 返回头(trailer 返回头字段)

    grpc-status: grpc 状态码,与 grpc 兼容

    grpc-message: 报错信息

    trace-proto-bin: trace 二进制信息

文档

Triple-go 文档

Extension points exported contracts — how you extend this code

TripleGrpcService (Interface)
TripleGrpcService is gRPC service, used to check impl [1 implementers]
pkg/common/service.go
IGreeter (Interface)
(no doc) [2 implementers]
example/dubbo/java-server/src/main/java/org/apache/dubbo/IGreeter.java
Option (FuncType)
Option instances may be used in OpenTracing(Server|Client)Interceptor initialization. See this post about the "function
pkg/tracing/server_interceptor.go
OptionFunction (FuncType)
nolint
pkg/config/config.go
Logger (Interface)
Logger is the interface for Logger types [1 implementers]
pkg/common/logger/logger.go
IGreeter (Interface)
(no doc) [1 implementers]
example/dubbo/java-client/src/main/java/org/apache/dubbo/IGreeter.java
SpanInclusionFunc (FuncType)
SpanInclusionFunc provides an optional mechanism to decide whether or not to trace a given gRPC call. Return true to cre
pkg/tracing/server_interceptor.go
CodecFactory (FuncType)
CodecFactory is Codec Factory
pkg/common/codec.go

Core symbols most depended-on inside this repo

Error
called by 13
pkg/common/logger/logger.go
Infof
called by 13
pkg/common/logger/logger.go
Errorf
called by 13
pkg/common/logger/logger.go
NewTripleOption
called by 13
pkg/config/config.go
Debugf
called by 9
pkg/common/logger/logger.go
Context
called by 9
pkg/tracing/server_interceptor.go
NewErrorWithAttachment
called by 7
pkg/common/service.go
SetSpanTags
called by 5
pkg/tracing/server_interceptor.go

Shape

Method 102
Function 76
Struct 21
Interface 15
FuncType 5
TypeAlias 4
Class 3

Languages

Go96%
Java4%

Modules by API surface

example/dubbo/proto/helloworld_triple.pb.go42 symbols
pkg/tracing/server_interceptor.go20 symbols
pkg/config/config.go20 symbols
example/dubbo/proto/helloworld.pb.go20 symbols
pkg/common/logger/logger.go19 symbols
pkg/common/service.go16 symbols
pkg/triple/dubbo3_server.go11 symbols
pkg/common/codec.go11 symbols
pkg/tracing/client_interceptor.go9 symbols
pkg/config/config_test.go9 symbols
example/dubbo/go-server/cmd/server.go7 symbols
pkg/triple/dubbo3_client.go6 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

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

⬇ download graph artifact