复制项目
This commit is contained in:
14
pkg/common/storage/versionctx/rpc.go
Normal file
14
pkg/common/storage/versionctx/rpc.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package versionctx
|
||||
|
||||
import (
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func EnableVersionCtx() grpc.ServerOption {
|
||||
return grpc.ChainUnaryInterceptor(enableVersionCtxInterceptor)
|
||||
}
|
||||
|
||||
func enableVersionCtxInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
|
||||
return handler(WithVersionLog(ctx), req)
|
||||
}
|
||||
Reference in New Issue
Block a user