update for latest micro

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-09-22 02:17:04 +03:00
parent d573acae5c
commit 047c791f3b
4 changed files with 56 additions and 17 deletions

18
options.go Normal file
View File

@@ -0,0 +1,18 @@
package jsonpb
import (
codec "github.com/unistack-org/micro/v3/codec"
jsonpb "google.golang.org/protobuf/encoding/protojson"
)
type unmarshalOptionsKey struct{}
func UnmarshalOptions(o jsonpb.UnmarshalOptions) codec.Option {
return codec.SetOption(unmarshalOptionsKey{}, o)
}
type marshalOptionsKey struct{}
func MarshalOptions(o jsonpb.MarshalOptions) codec.Option {
return codec.SetOption(marshalOptionsKey{}, o)
}