2021-09-22 02:17:04 +03:00
|
|
|
package jsonpb
|
|
|
|
|
|
|
|
import (
|
2023-04-30 11:03:28 +03:00
|
|
|
codec "go.unistack.org/micro/v4/codec"
|
2021-09-22 02:17:04 +03:00
|
|
|
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)
|
|
|
|
}
|