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