mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-27 22:12:15 +08:00
cmd gci write \
-s standard \
-s default \
-s "prefix(github.com/openimsdk/open-im-server/v3)"
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)
|
|
}
|