expose useful jsonpb defaults
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
5d3fe9018c
commit
7355dcd5a6
24
jsonpb.go
24
jsonpb.go
@ -14,10 +14,26 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
JsonpbMarshaler = &jsonpb.MarshalOptions{}
|
JsonpbMarshaler = jsonpb.MarshalOptions{
|
||||||
OldJsonpbMarshaler = &oldjsonpb.Marshaler{}
|
UseEnumNumbers: false,
|
||||||
JsonpbUnmarshaler = &jsonpb.UnmarshalOptions{}
|
EmitUnpopulated: false,
|
||||||
OldJsonpbUnmarshaler = &oldjsonpb.Unmarshaler{}
|
UseProtoNames: true,
|
||||||
|
AllowPartial: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonpbUnmarshaler = jsonpb.UnmarshalOptions{
|
||||||
|
DiscardUnknown: false,
|
||||||
|
AllowPartial: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
OldJsonpbMarshaler = oldjsonpb.Marshaler{
|
||||||
|
OrigName: true,
|
||||||
|
EmitDefaults: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
OldJsonpbUnmarshaler = oldjsonpb.Unmarshaler{
|
||||||
|
AllowUnknownFields: false,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
type jsonpbCodec struct {
|
type jsonpbCodec struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user