mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-28 22:58:10 +08:00
16 lines
358 B
Go
16 lines
358 B
Go
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)
|
|
}
|