后端
「连载六」Unary and Stream interceptor
Posts on 煎é±0 views
前言 我想在每个 RPC 方法的前或后做某些事情,怎么做? 本章节将要介绍的拦截器(interceptor),就能帮你在合适的地方实现这些功能。 有几种方法 在 gRPC 中,大类可分为两种 RPC 方法,与拦截器的对应关系是: 普通方法:一元拦截器(grpc.UnaryInterceptor) 流方法:流拦截器(grpc.StreamInterceptor) 看一看 grpc.UnaryInterceptor func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { return func(o *options) { if o.unaryInt != nil { panic("The unary server interceptor was already set and may not be reset.
Source:https://eddycjy.com/posts/go/grpc/2018-10-10-interceptor/Related posts
MCP 懒加载代理与 Chrome 会话标签组:按需拉起浏览器、容器与标签归组实战
0掘金
项目级 .agent/ 隔离、双协议 Hooks 与只读 DB/Redis 插件实战
0掘金
不用登录、不用后端:我把 AI 对话、Agent 和 Office 文档生产都做进了一个本地客户端
0掘金
Spring Boot 3 升级实战:真正吃掉工期的,是 MyBatis-Plus 坐标和 Security 6 重写
0掘金
别再用旧眼光看 MCP:新版协议到底改了什么,MCP Server 又该怎么写
0掘金
首饰、织物主图缩到 800×800 出摩尔纹?用 pica 在 Node 端对比 7 种缩放方式,量化假条纹和边缘光晕
0掘金