chore(deps): remove direct dependency on github.com/grpc-ecosystem/go-grpc-middleware (v1)

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2025-08-01 09:54:53 +02:00
parent 52083569c5
commit cf1208304a
11 changed files with 460 additions and 128 deletions

View File

@@ -5,11 +5,11 @@ import (
"fmt"
"github.com/fullstorydev/grpchan/inprocgrpc"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"google.golang.org/grpc"
insecure2 "google.golang.org/grpc/credentials/insecure"
"go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc-toolkit/interceptors/chain"
"go.linka.cloud/grpc-toolkit/interceptors/metadata"
)
@@ -34,10 +34,10 @@ func (s *service) wrapCC() grpc.ClientConnInterface {
}
w := &client{ch: s.inproc, c: c}
if len(s.opts.unaryClientInterceptors) != 0 {
w.ui = grpc_middleware.ChainUnaryClient(s.opts.unaryClientInterceptors...)
w.ui = chain.UnaryClient(s.opts.unaryClientInterceptors...)
}
if len(s.opts.streamClientInterceptors) != 0 {
w.si = grpc_middleware.ChainStreamClient(s.opts.streamClientInterceptors...)
w.si = chain.StreamClient(s.opts.streamClientInterceptors...)
}
return w
}

View File

@@ -16,7 +16,6 @@ import (
"github.com/fullstorydev/grpchan/inprocgrpc"
"github.com/google/uuid"
grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/justinas/alice"
"github.com/pires/go-proxyproto"
"github.com/rs/cors"
@@ -30,6 +29,7 @@ import (
"google.golang.org/grpc/health/grpc_health_v1"
greflect "google.golang.org/grpc/reflection"
"go.linka.cloud/grpc-toolkit/interceptors/chain"
"go.linka.cloud/grpc-toolkit/internal/injectlogger"
"go.linka.cloud/grpc-toolkit/logger"
"go.linka.cloud/grpc-toolkit/registry"
@@ -128,10 +128,10 @@ func newService(opts ...Option) (*service, error) {
return nil, err
}
ui := grpcmiddleware.ChainUnaryServer(s.opts.unaryServerInterceptors...)
ui := chain.UnaryServer(s.opts.unaryServerInterceptors...)
s.inproc = s.inproc.WithServerUnaryInterceptor(ui)
si := grpcmiddleware.ChainStreamServer(s.opts.streamServerInterceptors...)
si := chain.StreamServer(s.opts.streamServerInterceptors...)
s.inproc = s.inproc.WithServerStreamInterceptor(si)
gopts := []grpc.ServerOption{