prepare v4 (need swap target!) #195

Merged
vtolstov merged 4 commits from devstigneev/micro-server-grpc:prepare_v4 into v4 2025-03-02 21:13:26 +03:00
Showing only changes of commit 171d246752 - Show all commits

18
grpc.go
View File

@@ -10,7 +10,6 @@ import (
"slices" "slices"
"sort" "sort"
"strconv" "strconv"
"strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
@@ -19,7 +18,7 @@ import (
reflectionv1pb "google.golang.org/grpc/reflection/grpc_reflection_v1" reflectionv1pb "google.golang.org/grpc/reflection/grpc_reflection_v1"
// nolint: staticcheck // nolint: staticcheck
"go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v4/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v4/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v4/metadata" "go.unistack.org/micro/v4/metadata"
@@ -519,21 +518,6 @@ func (g *Server) processStream(ctx context.Context, stream grpc.ServerStream, se
return status.New(statusCode, statusDesc).Err() return status.New(statusCode, statusDesc).Err()
} }
func (g *Server) newCodec(ct string) (codec.Codec, error) {
g.RLock()
defer g.RUnlock()
if idx := strings.IndexRune(ct, ';'); idx >= 0 {
ct = ct[:idx]
}
if c, ok := g.opts.Codecs[ct]; ok {
return c, nil
}
return nil, codec.ErrUnknownContentType
}
func (g *Server) Options() server.Options { func (g *Server) Options() server.Options {
g.RLock() g.RLock()
opts := g.opts opts := g.opts