remove stale funcs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-06-15 23:23:42 +03:00
parent d3ef82346d
commit 25abc921d5
2 changed files with 3 additions and 19 deletions

View File

@ -1,16 +0,0 @@
package grpc
import (
"context"
"github.com/unistack-org/micro/v3/server"
)
func setServerOption(k, v interface{}) server.Option {
return func(o *server.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, k, v)
}
}

View File

@ -32,7 +32,7 @@ func Codec(contentType string, c encoding.Codec) server.Option {
// Options to be used to configure gRPC options
func Options(opts ...grpc.ServerOption) server.Option {
return setServerOption(grpcOptions{}, opts)
return server.SetOption(grpcOptions{}, opts)
}
//
@ -40,10 +40,10 @@ func Options(opts ...grpc.ServerOption) server.Option {
// send. Default maximum message size is 4 MB.
//
func MaxMsgSize(s int) server.Option {
return setServerOption(maxMsgSizeKey{}, s)
return server.SetOption(maxMsgSizeKey{}, s)
}
// Reflection enables reflection support in grpc server
func Reflection(b bool) server.Option {
return setServerOption(reflectionKey{}, b)
return server.SetOption(reflectionKey{}, b)
}