wrappers_gogo.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Protocol Buffers for Go with Gadgets
  2. //
  3. // Copyright (c) 2018, The GoGo Authors. All rights reserved.
  4. // http://github.com/gogo/protobuf
  5. //
  6. // Redistribution and use in source and binary forms, with or without
  7. // modification, are permitted provided that the following conditions are
  8. // met:
  9. //
  10. // * Redistributions of source code must retain the above copyright
  11. // notice, this list of conditions and the following disclaimer.
  12. // * Redistributions in binary form must reproduce the above
  13. // copyright notice, this list of conditions and the following disclaimer
  14. // in the documentation and/or other materials provided with the
  15. // distribution.
  16. //
  17. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  20. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  21. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  22. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  23. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. package proto
  29. type float64Value struct {
  30. Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
  31. }
  32. func (m *float64Value) Reset() { *m = float64Value{} }
  33. func (*float64Value) ProtoMessage() {}
  34. func (*float64Value) String() string { return "float64<string>" }
  35. type float32Value struct {
  36. Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`
  37. }
  38. func (m *float32Value) Reset() { *m = float32Value{} }
  39. func (*float32Value) ProtoMessage() {}
  40. func (*float32Value) String() string { return "float32<string>" }
  41. type int64Value struct {
  42. Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
  43. }
  44. func (m *int64Value) Reset() { *m = int64Value{} }
  45. func (*int64Value) ProtoMessage() {}
  46. func (*int64Value) String() string { return "int64<string>" }
  47. type uint64Value struct {
  48. Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
  49. }
  50. func (m *uint64Value) Reset() { *m = uint64Value{} }
  51. func (*uint64Value) ProtoMessage() {}
  52. func (*uint64Value) String() string { return "uint64<string>" }
  53. type int32Value struct {
  54. Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
  55. }
  56. func (m *int32Value) Reset() { *m = int32Value{} }
  57. func (*int32Value) ProtoMessage() {}
  58. func (*int32Value) String() string { return "int32<string>" }
  59. type uint32Value struct {
  60. Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
  61. }
  62. func (m *uint32Value) Reset() { *m = uint32Value{} }
  63. func (*uint32Value) ProtoMessage() {}
  64. func (*uint32Value) String() string { return "uint32<string>" }
  65. type boolValue struct {
  66. Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
  67. }
  68. func (m *boolValue) Reset() { *m = boolValue{} }
  69. func (*boolValue) ProtoMessage() {}
  70. func (*boolValue) String() string { return "bool<string>" }
  71. type stringValue struct {
  72. Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
  73. }
  74. func (m *stringValue) Reset() { *m = stringValue{} }
  75. func (*stringValue) ProtoMessage() {}
  76. func (*stringValue) String() string { return "string<string>" }
  77. type bytesValue struct {
  78. Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
  79. }
  80. func (m *bytesValue) Reset() { *m = bytesValue{} }
  81. func (*bytesValue) ProtoMessage() {}
  82. func (*bytesValue) String() string { return "[]byte<string>" }
  83. func init() {
  84. RegisterType((*float64Value)(nil), "gogo.protobuf.proto.DoubleValue")
  85. RegisterType((*float32Value)(nil), "gogo.protobuf.proto.FloatValue")
  86. RegisterType((*int64Value)(nil), "gogo.protobuf.proto.Int64Value")
  87. RegisterType((*uint64Value)(nil), "gogo.protobuf.proto.UInt64Value")
  88. RegisterType((*int32Value)(nil), "gogo.protobuf.proto.Int32Value")
  89. RegisterType((*uint32Value)(nil), "gogo.protobuf.proto.UInt32Value")
  90. RegisterType((*boolValue)(nil), "gogo.protobuf.proto.BoolValue")
  91. RegisterType((*stringValue)(nil), "gogo.protobuf.proto.StringValue")
  92. RegisterType((*bytesValue)(nil), "gogo.protobuf.proto.BytesValue")
  93. }