Lines Matching refs:marshaler
56 marshaler = Marshaler{} var
410 marshaler Marshaler
414 {"simple flat object", marshaler, simpleObject, simpleObjectOutputJSON},
416 {"non-finite floats fields object", marshaler, nonFinites, nonFinitesJSON},
417 {"repeated fields flat object", marshaler, repeatsObject, repeatsObjectJSON},
419 {"nested message/enum flat object", marshaler, complexObject, complexObjectJSON},
439 {"empty value", marshaler, &pb.Simple3{}, `{}`},
444 …{"map<int64, int32>", marshaler, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, `{"nummy":{"1":2,"…
446 {"map<string, string>", marshaler,
449 {"map<int32, Object>", marshaler,
453 {"map<int64, string>", marshaler, &pb.Mappy{Buggy: map[int64]string{1234: "yup"}},
455 …{"map<bool, bool>", marshaler, &pb.Mappy{Booly: map[bool]bool{false: true}}, `{"booly":{"false":tr…
456 …{"map<string, enum>", marshaler, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}},…
458 …{"map<int32, bool>", marshaler, &pb.Mappy{S32Booly: map[int32]bool{1: true, 3: false, 10: true, 12…
459 …{"map<int64, bool>", marshaler, &pb.Mappy{S64Booly: map[int64]bool{1: true, 3: false, 10: true, 12…
460 …{"map<uint32, bool>", marshaler, &pb.Mappy{U32Booly: map[uint32]bool{1: true, 3: false, 10: true, …
461 …{"map<uint64, bool>", marshaler, &pb.Mappy{U64Booly: map[uint64]bool{1: true, 3: false, 10: true, …
462 {"proto2 map<int64, string>", marshaler, &pb.Maps{MInt64Str: map[int64]string{213: "cat"}},
464 {"proto2 map<bool, Object>", marshaler,
467 {"oneof, not set", marshaler, &pb.MsgWithOneof{}, `{}`},
468 …{"oneof, set", marshaler, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Title{"Grand Poobah"}}, `{"titl…
471 {"proto2 extension", marshaler, realNumber, realNumberJSON},
472 {"Any with message", marshaler, anySimple, anySimpleJSON},
474 {"Any with WKT", marshaler, anyWellKnown, anyWellKnownJSON},
476 {"Duration empty", marshaler, &durpb.Duration{}, `"0s"`},
477 {"Duration with secs", marshaler, &durpb.Duration{Seconds: 3}, `"3s"`},
478 {"Duration with -secs", marshaler, &durpb.Duration{Seconds: -3}, `"-3s"`},
479 {"Duration with nanos", marshaler, &durpb.Duration{Nanos: 1e6}, `"0.001s"`},
480 {"Duration with -nanos", marshaler, &durpb.Duration{Nanos: -1e6}, `"-0.001s"`},
481 …{"Duration with large secs", marshaler, &durpb.Duration{Seconds: 1e10, Nanos: 1}, `"10000000000.00…
482 {"Duration with 6-digit nanos", marshaler, &durpb.Duration{Nanos: 1e4}, `"0.000010s"`},
483 {"Duration with 3-digit nanos", marshaler, &durpb.Duration{Nanos: 1e6}, `"0.001s"`},
484 …{"Duration with -secs -nanos", marshaler, &durpb.Duration{Seconds: -123, Nanos: -450}, `"-123.0000…
485 …{"Duration max value", marshaler, &durpb.Duration{Seconds: 315576000000, Nanos: 999999999}, `"3155…
486 …{"Duration min value", marshaler, &durpb.Duration{Seconds: -315576000000, Nanos: -999999999}, `"-3…
487 {"Struct", marshaler, &pb.KnownTypes{St: &stpb.Struct{
493 {"empty ListValue", marshaler, &pb.KnownTypes{Lv: &stpb.ListValue{}}, `{"lv":[]}`},
494 {"basic ListValue", marshaler, &pb.KnownTypes{Lv: &stpb.ListValue{Values: []*stpb.Value{
500 …{"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 21e6}}, `{"ts":"…
501 …{"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 0}}, `{"ts":"201…
502 …{"number Value", marshaler, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_NumberValue{1}}}, `{…
503 …{"null Value", marshaler, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_NullValue{stpb.NullVal…
504 …{"string number value", marshaler, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_StringValue{"…
505 {"list of lists Value", marshaler, &pb.KnownTypes{Val: &stpb.Value{
521 {"DoubleValue", marshaler, &pb.KnownTypes{Dbl: &wpb.DoubleValue{Value: 1.2}}, `{"dbl":1.2}`},
522 {"FloatValue", marshaler, &pb.KnownTypes{Flt: &wpb.FloatValue{Value: 1.2}}, `{"flt":1.2}`},
523 {"Int64Value", marshaler, &pb.KnownTypes{I64: &wpb.Int64Value{Value: -3}}, `{"i64":"-3"}`},
524 {"UInt64Value", marshaler, &pb.KnownTypes{U64: &wpb.UInt64Value{Value: 3}}, `{"u64":"3"}`},
525 {"Int32Value", marshaler, &pb.KnownTypes{I32: &wpb.Int32Value{Value: -4}}, `{"i32":-4}`},
526 {"UInt32Value", marshaler, &pb.KnownTypes{U32: &wpb.UInt32Value{Value: 4}}, `{"u32":4}`},
527 {"BoolValue", marshaler, &pb.KnownTypes{Bool: &wpb.BoolValue{Value: true}}, `{"bool":true}`},
528 …{"StringValue", marshaler, &pb.KnownTypes{Str: &wpb.StringValue{Value: "plush"}}, `{"str":"plush"}…
529 …{"BytesValue", marshaler, &pb.KnownTypes{Bytes: &wpb.BytesValue{Value: []byte("wow")}}, `{"bytes":…
531 {"required", marshaler, &pb.MsgWithRequired{Str: proto.String("hello")}, `{"str":"hello"}`},
532 {"required bytes", marshaler, &pb.MsgWithRequiredBytes{Byts: []byte{}}, `{"byts":""}`},
537 json, err := tt.marshaler.MarshalToString(tt.pb)
572 _, err := marshaler.MarshalToString(tt.pb)
613 marshaler := Marshaler{Indent: " "}
614 str, err = marshaler.MarshalToString(a)
654 marshaler *Marshaler
659 marshaler: &Marshaler{},
664 marshaler: &Marshaler{EmitDefaults: true},
669 marshaler: &Marshaler{},
674 marshaler: &Marshaler{EmitDefaults: true},
679 marshaler: &Marshaler{},
684 marshaler: &Marshaler{EmitDefaults: true},
689 marshaler: &Marshaler{},
694 marshaler: &Marshaler{},
703 marshaler: &Marshaler{},
713 marshaler: &Marshaler{},
720 marshaler: &Marshaler{},
726 if _, err := tc.marshaler.MarshalToString(tc.pb); err == nil {