We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bm 中原来通过 Keys 字段在多个 handler 之间传递额外的数据,比如通过 token拿到的 userid。但是这种方式要求 http 层必须编写额外的代码来保证从 bm 的 Context 中获取了正确的 userid。
token
userid
考虑到和 gRPC 的 metadata 模式与代码生成的一致性,考虑将 Keys 字段改成使用 valueContext 存储 metadata 来进行传递。
去除 bm 中 Context.Keys 改为使用类似 gRPC 中的 metadata 形式,metadata 存储与 valueContext 中,这样可以使 gRPC 的 service 逻辑与 bm 的 service 逻辑统一,也为之后网关全面迁移 gRPC 打下基础。
Context.Keys
valueContext
metadata 的跨服务传递性?
bm Context 中的 Keys 字段被去除,并通过类似 gRPC 的 metadata 形式代替。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Background
bm 中原来通过 Keys 字段在多个 handler 之间传递额外的数据,比如通过
token
拿到的userid
。但是这种方式要求 http 层必须编写额外的代码来保证从 bm 的 Context 中获取了正确的 userid。考虑到和 gRPC 的 metadata 模式与代码生成的一致性,考虑将 Keys 字段改成使用 valueContext 存储 metadata 来进行传递。
Suggestion
去除 bm 中
Context.Keys
改为使用类似 gRPC 中的 metadata 形式,metadata 存储与valueContext
中,这样可以使 gRPC 的 service 逻辑与 bm 的 service 逻辑统一,也为之后网关全面迁移 gRPC 打下基础。metadata 的跨服务传递性?
Expected behaviour
bm Context 中的 Keys 字段被去除,并通过类似 gRPC 的 metadata 形式代替。
The text was updated successfully, but these errors were encountered: