Files
Zach LeslieandGitHub a6f3928b05 Update dskit and adjust memcached interface signature (#5604)
* Update dskit and adjust memcached interface signature

* Generate config manifest
2025-09-03 18:34:46 +02:00

26 lines
528 B
Go

package grpcutil
import (
"context"
"google.golang.org/grpc/tap"
)
// ComposeTapHandles allows multiple tap handles to be composed, since only one may be specified by gRPC server.
func ComposeTapHandles(handles []tap.ServerInHandle) tap.ServerInHandle {
if len(handles) == 1 {
return handles[0]
}
return func(ctx context.Context, info *tap.Info) (context.Context, error) {
var err error
for _, h := range handles {
ctx, err = h(ctx, info)
if err != nil {
return ctx, err
}
}
return ctx, nil
}
}