prepare v4 (need swap target!) #195
18
grpc.go
18
grpc.go
@@ -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
|
||||||
|
Reference in New Issue
Block a user