remove stale funcs
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
d3ef82346d
commit
25abc921d5
16
context.go
16
context.go
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
@ -32,7 +32,7 @@ func Codec(contentType string, c encoding.Codec) server.Option {
|
|||||||
|
|
||||||
// Options to be used to configure gRPC options
|
// Options to be used to configure gRPC options
|
||||||
func Options(opts ...grpc.ServerOption) server.Option {
|
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.
|
// send. Default maximum message size is 4 MB.
|
||||||
//
|
//
|
||||||
func MaxMsgSize(s int) server.Option {
|
func MaxMsgSize(s int) server.Option {
|
||||||
return setServerOption(maxMsgSizeKey{}, s)
|
return server.SetOption(maxMsgSizeKey{}, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reflection enables reflection support in grpc server
|
// Reflection enables reflection support in grpc server
|
||||||
func Reflection(b bool) server.Option {
|
func Reflection(b bool) server.Option {
|
||||||
return setServerOption(reflectionKey{}, b)
|
return server.SetOption(reflectionKey{}, b)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user