You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
357 B
15 lines
357 B
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)
|
|
}
|