micro-codec-proto/options.go
Vasiliy Tolstov d466a05b9d update codec to allow reuse buffers
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-09-16 23:44:26 +03:00

19 lines
396 B
Go

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)
}