doc: mark CustomCodec as deprecated (#3698)
This commit is contained in:
14
server.go
14
server.go
@ -243,6 +243,12 @@ func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption {
|
|||||||
// CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling.
|
// CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling.
|
||||||
//
|
//
|
||||||
// This will override any lookups by content-subtype for Codecs registered with RegisterCodec.
|
// This will override any lookups by content-subtype for Codecs registered with RegisterCodec.
|
||||||
|
//
|
||||||
|
// Deprecated: register codecs using encoding.RegisterCodec. The server will
|
||||||
|
// automatically use registered codecs based on the incoming requests' headers.
|
||||||
|
// See also
|
||||||
|
// https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec.
|
||||||
|
// Will be supported throughout 1.x.
|
||||||
func CustomCodec(codec Codec) ServerOption {
|
func CustomCodec(codec Codec) ServerOption {
|
||||||
return newFuncServerOption(func(o *serverOptions) {
|
return newFuncServerOption(func(o *serverOptions) {
|
||||||
o.codec = codec
|
o.codec = codec
|
||||||
@ -255,7 +261,8 @@ func CustomCodec(codec Codec) ServerOption {
|
|||||||
// default, server messages will be sent using the same compressor with which
|
// default, server messages will be sent using the same compressor with which
|
||||||
// request messages were sent.
|
// request messages were sent.
|
||||||
//
|
//
|
||||||
// Deprecated: use encoding.RegisterCompressor instead.
|
// Deprecated: use encoding.RegisterCompressor instead. Will be supported
|
||||||
|
// throughout 1.x.
|
||||||
func RPCCompressor(cp Compressor) ServerOption {
|
func RPCCompressor(cp Compressor) ServerOption {
|
||||||
return newFuncServerOption(func(o *serverOptions) {
|
return newFuncServerOption(func(o *serverOptions) {
|
||||||
o.cp = cp
|
o.cp = cp
|
||||||
@ -266,7 +273,8 @@ func RPCCompressor(cp Compressor) ServerOption {
|
|||||||
// messages. It has higher priority than decompressors registered via
|
// messages. It has higher priority than decompressors registered via
|
||||||
// encoding.RegisterCompressor.
|
// encoding.RegisterCompressor.
|
||||||
//
|
//
|
||||||
// Deprecated: use encoding.RegisterCompressor instead.
|
// Deprecated: use encoding.RegisterCompressor instead. Will be supported
|
||||||
|
// throughout 1.x.
|
||||||
func RPCDecompressor(dc Decompressor) ServerOption {
|
func RPCDecompressor(dc Decompressor) ServerOption {
|
||||||
return newFuncServerOption(func(o *serverOptions) {
|
return newFuncServerOption(func(o *serverOptions) {
|
||||||
o.dc = dc
|
o.dc = dc
|
||||||
@ -276,7 +284,7 @@ func RPCDecompressor(dc Decompressor) ServerOption {
|
|||||||
// MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive.
|
// MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive.
|
||||||
// If this is not set, gRPC uses the default limit.
|
// If this is not set, gRPC uses the default limit.
|
||||||
//
|
//
|
||||||
// Deprecated: use MaxRecvMsgSize instead.
|
// Deprecated: use MaxRecvMsgSize instead. Will be supported throughout 1.x.
|
||||||
func MaxMsgSize(m int) ServerOption {
|
func MaxMsgSize(m int) ServerOption {
|
||||||
return MaxRecvMsgSize(m)
|
return MaxRecvMsgSize(m)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user