update codec to allow reuse buffers
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
18
options.go
Normal file
18
options.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
codec "go.unistack.org/micro/v3/codec"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type unmarshalOptionsKey struct{}
|
||||
|
||||
func UnmarshalOptions(o proto.UnmarshalOptions) codec.Option {
|
||||
return codec.SetOption(unmarshalOptionsKey{}, o)
|
||||
}
|
||||
|
||||
type marshalOptionsKey struct{}
|
||||
|
||||
func MarshalOptions(o proto.MarshalOptions) codec.Option {
|
||||
return codec.SetOption(marshalOptionsKey{}, o)
|
||||
}
|
Reference in New Issue
Block a user