-benchmark | old ns/op | new ns/op | delta |
-BenchmarkNidOptNativeProtoMarshal | 2656 | 889 | -66.53% |
-BenchmarkNinOptNativeProtoMarshal | 2651 | 1015 | -61.71% |
-BenchmarkNidRepNativeProtoMarshal | 42661 | 12519 | -70.65% |
-BenchmarkNinRepNativeProtoMarshal | 42306 | 12354 | -70.80% |
-BenchmarkNidRepPackedNativeProtoMarshal | 34148 | 11902 | -65.15% |
-BenchmarkNinRepPackedNativeProtoMarshal | 33375 | 11969 | -64.14% |
-BenchmarkNidOptStructProtoMarshal | 7148 | 3727 | -47.86% |
-BenchmarkNinOptStructProtoMarshal | 6956 | 3481 | -49.96% |
-BenchmarkNidRepStructProtoMarshal | 46551 | 19492 | -58.13% |
-BenchmarkNinRepStructProtoMarshal | 46715 | 19043 | -59.24% |
-BenchmarkNidEmbeddedStructProtoMarshal | 5231 | 2050 | -60.81% |
-BenchmarkNinEmbeddedStructProtoMarshal | 4665 | 2000 | -57.13% |
-BenchmarkNidNestedStructProtoMarshal | 181106 | 103604 | -42.79% |
-BenchmarkNinNestedStructProtoMarshal | 182053 | 102069 | -43.93% |
-BenchmarkNidOptCustomProtoMarshal | 1209 | 310 | -74.36% |
-BenchmarkNinOptCustomProtoMarshal | 1435 | 277 | -80.70% |
-BenchmarkNidRepCustomProtoMarshal | 4126 | 763 | -81.51% |
-BenchmarkNinRepCustomProtoMarshal | 3972 | 769 | -80.64% |
-BenchmarkNinOptNativeUnionProtoMarshal | 973 | 303 | -68.86% |
-BenchmarkNinOptStructUnionProtoMarshal | 1536 | 521 | -66.08% |
-BenchmarkNinEmbeddedStructUnionProtoMarshal | 2327 | 884 | -62.01% |
-BenchmarkNinNestedStructUnionProtoMarshal | 2070 | 743 | -64.11% |
-BenchmarkTreeProtoMarshal | 1554 | 838 | -46.07% |
-BenchmarkOrBranchProtoMarshal | 3156 | 2012 | -36.25% |
-BenchmarkAndBranchProtoMarshal | 3183 | 1996 | -37.29% |
-BenchmarkLeafProtoMarshal | 965 | 606 | -37.20% |
-BenchmarkDeepTreeProtoMarshal | 2316 | 1283 | -44.60% |
-BenchmarkADeepBranchProtoMarshal | 2719 | 1492 | -45.13% |
-BenchmarkAndDeepBranchProtoMarshal | 4663 | 2922 | -37.34% |
-BenchmarkDeepLeafProtoMarshal | 1849 | 1016 | -45.05% |
-BenchmarkNilProtoMarshal | 439 | 76 | -82.53% |
-BenchmarkNidOptEnumProtoMarshal | 514 | 152 | -70.43% |
-BenchmarkNinOptEnumProtoMarshal | 550 | 158 | -71.27% |
-BenchmarkNidRepEnumProtoMarshal | 647 | 207 | -68.01% |
-BenchmarkNinRepEnumProtoMarshal | 662 | 213 | -67.82% |
-BenchmarkTimerProtoMarshal | 934 | 271 | -70.99% |
-BenchmarkMyExtendableProtoMarshal | 608 | 185 | -69.57% |
-BenchmarkOtherExtenableProtoMarshal | 1112 | 332 | -70.14% |
-
-
-
-benchmark | old MB/s | new MB/s | speedup |
-BenchmarkNidOptNativeProtoMarshal | 126.86 | 378.86 | 2.99x |
-BenchmarkNinOptNativeProtoMarshal | 114.27 | 298.42 | 2.61x |
-BenchmarkNidRepNativeProtoMarshal | 164.25 | 561.20 | 3.42x |
-BenchmarkNinRepNativeProtoMarshal | 166.10 | 568.23 | 3.42x |
-BenchmarkNidRepPackedNativeProtoMarshal | 99.10 | 283.97 | 2.87x |
-BenchmarkNinRepPackedNativeProtoMarshal | 101.30 | 282.31 | 2.79x |
-BenchmarkNidOptStructProtoMarshal | 176.83 | 339.07 | 1.92x |
-BenchmarkNinOptStructProtoMarshal | 163.59 | 326.57 | 2.00x |
-BenchmarkNidRepStructProtoMarshal | 178.84 | 427.49 | 2.39x |
-BenchmarkNinRepStructProtoMarshal | 178.70 | 437.69 | 2.45x |
-BenchmarkNidEmbeddedStructProtoMarshal | 124.24 | 317.56 | 2.56x |
-BenchmarkNinEmbeddedStructProtoMarshal | 132.03 | 307.99 | 2.33x |
-BenchmarkNidNestedStructProtoMarshal | 192.91 | 337.86 | 1.75x |
-BenchmarkNinNestedStructProtoMarshal | 192.44 | 344.45 | 1.79x |
-BenchmarkNidOptCustomProtoMarshal | 29.77 | 116.03 | 3.90x |
-BenchmarkNinOptCustomProtoMarshal | 22.29 | 115.38 | 5.18x |
-BenchmarkNidRepCustomProtoMarshal | 35.14 | 189.80 | 5.40x |
-BenchmarkNinRepCustomProtoMarshal | 36.50 | 188.40 | 5.16x |
-BenchmarkNinOptNativeUnionProtoMarshal | 32.87 | 105.39 | 3.21x |
-BenchmarkNinOptStructUnionProtoMarshal | 66.40 | 195.76 | 2.95x |
-BenchmarkNinEmbeddedStructUnionProtoMarshal | 93.24 | 245.26 | 2.63x |
-BenchmarkNinNestedStructUnionProtoMarshal | 57.49 | 160.06 | 2.78x |
-BenchmarkTreeProtoMarshal | 137.64 | 255.12 | 1.85x |
-BenchmarkOrBranchProtoMarshal | 137.80 | 216.10 | 1.57x |
-BenchmarkAndBranchProtoMarshal | 136.64 | 217.89 | 1.59x |
-BenchmarkLeafProtoMarshal | 214.48 | 341.53 | 1.59x |
-BenchmarkDeepTreeProtoMarshal | 95.85 | 173.03 | 1.81x |
-BenchmarkADeepBranchProtoMarshal | 82.73 | 150.78 | 1.82x |
-BenchmarkAndDeepBranchProtoMarshal | 96.72 | 153.98 | 1.59x |
-BenchmarkDeepLeafProtoMarshal | 117.34 | 213.41 | 1.82x |
-BenchmarkNidOptEnumProtoMarshal | 3.89 | 13.16 | 3.38x |
-BenchmarkNinOptEnumProtoMarshal | 1.82 | 6.30 | 3.46x |
-BenchmarkNidRepEnumProtoMarshal | 12.36 | 38.50 | 3.11x |
-BenchmarkNinRepEnumProtoMarshal | 12.08 | 37.53 | 3.11x |
-BenchmarkTimerProtoMarshal | 73.81 | 253.87 | 3.44x |
-BenchmarkMyExtendableProtoMarshal | 13.15 | 43.08 | 3.28x |
-BenchmarkOtherExtenableProtoMarshal | 24.28 | 81.09 | 3.34x |
-
-
-## Unmarshaler
-
-
-benchmark | old ns/op | new ns/op | delta |
-BenchmarkNidOptNativeProtoUnmarshal | 2521 | 1006 | -60.10% |
-BenchmarkNinOptNativeProtoUnmarshal | 2529 | 1750 | -30.80% |
-BenchmarkNidRepNativeProtoUnmarshal | 49067 | 35299 | -28.06% |
-BenchmarkNinRepNativeProtoUnmarshal | 47990 | 35456 | -26.12% |
-BenchmarkNidRepPackedNativeProtoUnmarshal | 26456 | 23950 | -9.47% |
-BenchmarkNinRepPackedNativeProtoUnmarshal | 26499 | 24037 | -9.29% |
-BenchmarkNidOptStructProtoUnmarshal | 6803 | 3873 | -43.07% |
-BenchmarkNinOptStructProtoUnmarshal | 6786 | 4154 | -38.79% |
-BenchmarkNidRepStructProtoUnmarshal | 56276 | 31970 | -43.19% |
-BenchmarkNinRepStructProtoUnmarshal | 48750 | 31832 | -34.70% |
-BenchmarkNidEmbeddedStructProtoUnmarshal | 4556 | 1973 | -56.69% |
-BenchmarkNinEmbeddedStructProtoUnmarshal | 4485 | 1975 | -55.96% |
-BenchmarkNidNestedStructProtoUnmarshal | 223395 | 135844 | -39.19% |
-BenchmarkNinNestedStructProtoUnmarshal | 226446 | 134022 | -40.82% |
-BenchmarkNidOptCustomProtoUnmarshal | 1859 | 300 | -83.86% |
-BenchmarkNinOptCustomProtoUnmarshal | 1486 | 402 | -72.95% |
-BenchmarkNidRepCustomProtoUnmarshal | 8229 | 1669 | -79.72% |
-BenchmarkNinRepCustomProtoUnmarshal | 8253 | 1649 | -80.02% |
-BenchmarkNinOptNativeUnionProtoUnmarshal | 840 | 307 | -63.45% |
-BenchmarkNinOptStructUnionProtoUnmarshal | 1395 | 639 | -54.19% |
-BenchmarkNinEmbeddedStructUnionProtoUnmarshal | 2297 | 1167 | -49.19% |
-BenchmarkNinNestedStructUnionProtoUnmarshal | 1820 | 889 | -51.15% |
-BenchmarkTreeProtoUnmarshal | 1521 | 720 | -52.66% |
-BenchmarkOrBranchProtoUnmarshal | 2669 | 1385 | -48.11% |
-BenchmarkAndBranchProtoUnmarshal | 2667 | 1420 | -46.76% |
-BenchmarkLeafProtoUnmarshal | 1171 | 584 | -50.13% |
-BenchmarkDeepTreeProtoUnmarshal | 2065 | 1081 | -47.65% |
-BenchmarkADeepBranchProtoUnmarshal | 2695 | 1178 | -56.29% |
-BenchmarkAndDeepBranchProtoUnmarshal | 4055 | 1918 | -52.70% |
-BenchmarkDeepLeafProtoUnmarshal | 1758 | 865 | -50.80% |
-BenchmarkNilProtoUnmarshal | 564 | 63 | -88.79% |
-BenchmarkNidOptEnumProtoUnmarshal | 762 | 73 | -90.34% |
-BenchmarkNinOptEnumProtoUnmarshal | 764 | 163 | -78.66% |
-BenchmarkNidRepEnumProtoUnmarshal | 1078 | 447 | -58.53% |
-BenchmarkNinRepEnumProtoUnmarshal | 1071 | 479 | -55.28% |
-BenchmarkTimerProtoUnmarshal | 1128 | 362 | -67.91% |
-BenchmarkMyExtendableProtoUnmarshal | 808 | 217 | -73.14% |
-BenchmarkOtherExtenableProtoUnmarshal | 1233 | 517 | -58.07% |
-
-
-
-benchmark | old MB/s | new MB/s | speedup |
-BenchmarkNidOptNativeProtoUnmarshal | 133.67 | 334.98 | 2.51x |
-BenchmarkNinOptNativeProtoUnmarshal | 119.77 | 173.08 | 1.45x |
-BenchmarkNidRepNativeProtoUnmarshal | 143.23 | 199.12 | 1.39x |
-BenchmarkNinRepNativeProtoUnmarshal | 146.07 | 198.16 | 1.36x |
-BenchmarkNidRepPackedNativeProtoUnmarshal | 127.80 | 141.04 | 1.10x |
-BenchmarkNinRepPackedNativeProtoUnmarshal | 127.55 | 140.78 | 1.10x |
-BenchmarkNidOptStructProtoUnmarshal | 185.79 | 326.31 | 1.76x |
-BenchmarkNinOptStructProtoUnmarshal | 167.68 | 273.66 | 1.63x |
-BenchmarkNidRepStructProtoUnmarshal | 147.88 | 260.39 | 1.76x |
-BenchmarkNinRepStructProtoUnmarshal | 171.20 | 261.97 | 1.53x |
-BenchmarkNidEmbeddedStructProtoUnmarshal | 142.86 | 329.42 | 2.31x |
-BenchmarkNinEmbeddedStructProtoUnmarshal | 137.33 | 311.83 | 2.27x |
-BenchmarkNidNestedStructProtoUnmarshal | 154.97 | 259.47 | 1.67x |
-BenchmarkNinNestedStructProtoUnmarshal | 154.32 | 258.42 | 1.67x |
-BenchmarkNidOptCustomProtoUnmarshal | 19.36 | 119.66 | 6.18x |
-BenchmarkNinOptCustomProtoUnmarshal | 21.52 | 79.50 | 3.69x |
-BenchmarkNidRepCustomProtoUnmarshal | 17.62 | 86.86 | 4.93x |
-BenchmarkNinRepCustomProtoUnmarshal | 17.57 | 87.92 | 5.00x |
-BenchmarkNinOptNativeUnionProtoUnmarshal | 38.07 | 104.12 | 2.73x |
-BenchmarkNinOptStructUnionProtoUnmarshal | 73.08 | 159.54 | 2.18x |
-BenchmarkNinEmbeddedStructUnionProtoUnmarshal | 94.00 | 185.92 | 1.98x |
-BenchmarkNinNestedStructUnionProtoUnmarshal | 65.35 | 133.75 | 2.05x |
-BenchmarkTreeProtoUnmarshal | 141.28 | 297.13 | 2.10x |
-BenchmarkOrBranchProtoUnmarshal | 162.56 | 313.96 | 1.93x |
-BenchmarkAndBranchProtoUnmarshal | 163.06 | 306.15 | 1.88x |
-BenchmarkLeafProtoUnmarshal | 176.72 | 354.19 | 2.00x |
-BenchmarkDeepTreeProtoUnmarshal | 107.50 | 205.30 | 1.91x |
-BenchmarkADeepBranchProtoUnmarshal | 83.48 | 190.88 | 2.29x |
-BenchmarkAndDeepBranchProtoUnmarshal | 110.97 | 234.60 | 2.11x |
-BenchmarkDeepLeafProtoUnmarshal | 123.40 | 250.73 | 2.03x |
-BenchmarkNidOptEnumProtoUnmarshal | 2.62 | 27.16 | 10.37x |
-BenchmarkNinOptEnumProtoUnmarshal | 1.31 | 6.11 | 4.66x |
-BenchmarkNidRepEnumProtoUnmarshal | 7.42 | 17.88 | 2.41x |
-BenchmarkNinRepEnumProtoUnmarshal | 7.47 | 16.69 | 2.23x |
-BenchmarkTimerProtoUnmarshal | 61.12 | 190.34 | 3.11x |
-BenchmarkMyExtendableProtoUnmarshal | 9.90 | 36.71 | 3.71x |
-BenchmarkOtherExtenableProtoUnmarshal | 21.90 | 52.13 | 2.38x |
-
\ No newline at end of file
diff --git a/vendor/github.com/gogo/protobuf/codec/codec.go b/vendor/github.com/gogo/protobuf/codec/codec.go
deleted file mode 100644
index 91d10fe..0000000
--- a/vendor/github.com/gogo/protobuf/codec/codec.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2015, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package codec
-
-import (
- "github.com/gogo/protobuf/proto"
-)
-
-type Codec interface {
- Marshal(v interface{}) ([]byte, error)
- Unmarshal(data []byte, v interface{}) error
- String() string
-}
-
-type marshaler interface {
- MarshalTo(data []byte) (n int, err error)
-}
-
-func getSize(v interface{}) (int, bool) {
- if sz, ok := v.(interface {
- Size() (n int)
- }); ok {
- return sz.Size(), true
- } else if sz, ok := v.(interface {
- ProtoSize() (n int)
- }); ok {
- return sz.ProtoSize(), true
- } else {
- return 0, false
- }
-}
-
-type codec struct {
- buf []byte
-}
-
-func (this *codec) String() string {
- return "proto"
-}
-
-func New(size int) Codec {
- return &codec{make([]byte, size)}
-}
-
-func (this *codec) Marshal(v interface{}) ([]byte, error) {
- if m, ok := v.(marshaler); ok {
- n, ok := getSize(v)
- if !ok {
- return proto.Marshal(v.(proto.Message))
- }
- if n > len(this.buf) {
- this.buf = make([]byte, n)
- }
- _, err := m.MarshalTo(this.buf)
- if err != nil {
- return nil, err
- }
- return this.buf[:n], nil
- }
- return proto.Marshal(v.(proto.Message))
-}
-
-func (this *codec) Unmarshal(data []byte, v interface{}) error {
- return proto.Unmarshal(data, v.(proto.Message))
-}
diff --git a/vendor/github.com/gogo/protobuf/codec/codec_test.go b/vendor/github.com/gogo/protobuf/codec/codec_test.go
deleted file mode 100644
index de2c9bc..0000000
--- a/vendor/github.com/gogo/protobuf/codec/codec_test.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2015, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package codec
-
-import (
- "github.com/gogo/protobuf/test"
- "math/rand"
- "testing"
- "time"
-)
-
-func TestCodec(t *testing.T) {
- r := rand.New(rand.NewSource(time.Now().UnixNano()))
- in := test.NewPopulatedNinOptStruct(r, true)
- c := New(r.Intn(1024))
- data, err := c.Marshal(in)
- if err != nil {
- t.Fatal(err)
- }
- out := &test.NinOptStruct{}
- err = c.Unmarshal(data, out)
- if err != nil {
- t.Fatal(err)
- }
- if err := in.VerboseEqual(out); err != nil {
- t.Fatal(err)
- }
-}
diff --git a/vendor/github.com/gogo/protobuf/custom_types.md b/vendor/github.com/gogo/protobuf/custom_types.md
deleted file mode 100644
index 3eed249..0000000
--- a/vendor/github.com/gogo/protobuf/custom_types.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# Custom types
-
-Custom types is a gogo protobuf extensions that allows for using a custom
-struct type to decorate the underlying structure of the protocol message.
-
-# How to use
-
-## Defining the protobuf message
-
-```proto
-message CustomType {
- optional ProtoType Field = 1 [(gogoproto.customtype) = "T"];
-}
-
-message ProtoType {
- optional string Field = 1;
-}
-```
-
-or alternatively you can declare the field type in the protocol message to be
-`bytes`:
-
-```proto
-message BytesCustomType {
- optional bytes Field = 1 [(gogoproto.customtype) = "T"];
-}
-```
-
-The downside of using `bytes` is that it makes it harder to generate protobuf
-code in other languages. In either case, it is the user responsibility to
-ensure that the custom type marshals and unmarshals to the expected wire
-format. That is, in the first example, gogo protobuf will not attempt to ensure
-that the wire format of `ProtoType` and `T` are wire compatible.
-
-## Custom type method signatures
-
-The custom type must define the following methods with the given
-signatures. Assuming the custom type is called `T`:
-
-```go
-func (t T) Marshal() ([]byte, error) {}
-func (t *T) MarshalTo(data []byte) (n int, err error) {}
-func (t *T) Unmarshal(data []byte) error {}
-
-func (t T) MarshalJSON() ([]byte, error) {}
-func (t *T) UnmarshalJSON(data []byte) error {}
-
-// only required if the compare option is set
-func (t T) Compare(other T) int {}
-// only required if the equal option is set
-func (t T) Equal(other T) bool {}
-// only required if populate option is set
-func NewPopulatedT(r randyThetest) *T {}
-```
-
-Check [t.go](test/t.go) for a full example
-
-# Warnings and issues
-
-`Warning about customtype: It is your responsibility to test all cases of your marshaling, unmarshaling and size methods implemented for your custom type.`
-
-Issues with customtype include:
- *
-Name | Option | Type | Description | Default |
-marshaler | Message | bool | if true, a Marshal and MarshalTo method is generated for the specific message | false |
-sizer | Message | bool | if true, a Size method is generated for the specific message | false |
-unmarshaler | Message | bool | if true, an Unmarshal method is generated for the specific message | false |
-protosizer | Message | bool | if true, a ProtoSize method is generated for the specific message | false |
- unsafe_marshaler | Message | bool | if true, a Marshal and MarshalTo method is generated for the specific message. The generated code uses the unsafe package and is not compatible with big endian CPUs. | false |
-unsafe_unmarshaler | Message | bool | if true, an Unmarshal method is generated for the specific message. The generated code uses the unsafe package and is not compatible with big endian CPUs. | false |
-stable_marshaler | Message | bool | if true, a Marshal and MarshalTo method is generated for the specific message, but unlike marshaler the output is guaranteed to be deterministic, at the sacrifice of some speed | false |
-typedecl (beta) | Message | bool | if false, type declaration of the message is excluded from the generated output. Requires the marshaler and unmarshaler to be generated. | true |
-
-
-# More Canonical Go Structures
-
-Lots of times working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs.
-
-You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a new struct.
-
-`gogoprotobuf` tries to fix these problems with the nullable, embed, customtype, customname, casttype, castkey and castvalue field extensions.
-
-
-Name | Option | Type | Description | Default |
-nullable | Field | bool | if false, a field is generated without a pointer (see warning below). | true |
-embed | Field | bool | if true, the field is generated as an embedded field. | false |
-customtype | Field | string | It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128. For more information please refer to the CustomTypes document | goprotobuf type |
- customname (beta) | Field | string | Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames. | goprotobuf field name |
- casttype (beta) | Field | string | Changes the generated field type. It assumes that this type is castable to the original goprotobuf field type. It currently does not support maps, structs or enums. | goprotobuf field type |
- castkey (beta) | Field | string | Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. | goprotobuf field type |
- castvalue (beta) | Field | string | Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. | goprotobuf field type |
-enum_customname (beta) | Enum | string | Sets the type name of an enum. If goproto_enum_prefix is enabled, this value will be used as a prefix when generating enum values. | goprotobuf enum type name. Helps with golint issues. |
-enumdecl (beta) | Enum | bool | if false, type declaration of the enum is excluded from the generated output. Requires the marshaler and unmarshaler to be generated. | true |
-enumvalue_customname (beta) | Enum Value | string | Changes the generated enum name. Helps with golint issues. | goprotobuf enum value name |
-stdtime | Timestamp Field | bool | Changes the Well Known Timestamp Type to time.Time | Timestamp |
-stdduration | Duration Field | bool | Changes the Well Known Duration Type to time.Duration | Duration |
-
-
-`Warning about nullable: according to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set.`
-
-# Goprotobuf Compatibility
-
-Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers (see the section on tests below).
-
-Gogoprotobuf generates the same code as goprotobuf if no extensions are used.
-
-The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf.
-
-
-Name | Option | Type | Description | Default |
- gogoproto_import | File | bool | if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto. | true |
- goproto_enum_prefix | Enum | bool | if false, generates the enum constant names without the messagetype prefix | true |
- goproto_getters | Message | bool | if false, the message is generated without get methods, this is useful when you would rather want to use face | true |
- goproto_stringer | Message | bool | if false, the message is generated without the default string method, this is useful for rather using stringer | true |
- goproto_enum_stringer (experimental) | Enum | bool | if false, the enum is generated without the default string method, this is useful for rather using enum_stringer | true |
- goproto_extensions_map (beta) | Message | bool | if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension | true |
- goproto_unrecognized (beta) | Message | bool | if false, XXX_unrecognized field is not generated. This is useful to reduce GC pressure at the cost of losing information about unrecognized fields. | true |
-
-
-# Less Typing
-
-The Protocol Buffer language is very parseable and extra code can be easily generated for structures.
-
-Helper methods, functions and interfaces can be generated by triggering certain extensions like gostring.
-
-
-Name | Option | Type | Description | Default |
-gostring | Message | bool | if true, a `GoString` method is generated. This returns a string representing valid go code to reproduce the current state of the struct. | false |
- onlyone (deprecated) | Message | bool | if true, all fields must be nullable and only one of the fields may be set, like a union. Two methods are generated: `GetValue() interface{}` and `SetValue(v interface{}) (set bool)`. These provide easier interaction with a union. | false |
- equal | Message | bool | if true, an Equal method is generated | false |
- compare | Message | bool | if true, a Compare method is generated. This is very useful for quickly implementing sort on a list of protobuf structs | false |
- verbose_equal | Message | bool | if true, a verbose equal method is generated for the message. This returns an error which describes the exact element which is not equal to the exact element in the other struct. | false |
- stringer | Message | bool | if true, a String method is generated for the message. | false |
-face | Message | bool | if true, a function will be generated which can convert a structure which satisfies an interface (face) to the specified structure. This interface contains getters for each of the fields in the struct. The specified struct is also generated with the getters. This allows it to satisfy its own face. | false |
- description (beta) | Message | bool | if true, a Description method is generated for the message. | false |
- populate | Message | bool | if true, a `NewPopulated` function is generated. This is necessary for generated tests. | false |
- enum_stringer (experimental) | Enum | bool | if true, a String method is generated for an Enum | false |
-
-
-Issues with Compare include:
- *