micro-codec-jsonpb/options.go
Vasiliy Tolstov 8fc8af418b move to micro v4
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-04-30 11:03:28 +03:00

19 lines
419 B
Go

package jsonpb
import (
codec "go.unistack.org/micro/v4/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)
}