test.pb.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Code generated by protoc-gen-go.
  2. // source: test.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package protoexample is a generated protocol buffer package.
  6. It is generated from these files:
  7. test.proto
  8. It has these top-level messages:
  9. Test
  10. */
  11. package protoexample
  12. import proto "github.com/golang/protobuf/proto"
  13. import math "math"
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = math.Inf
  17. type FOO int32
  18. const (
  19. FOO_X FOO = 17
  20. )
  21. var FOO_name = map[int32]string{
  22. 17: "X",
  23. }
  24. var FOO_value = map[string]int32{
  25. "X": 17,
  26. }
  27. func (x FOO) Enum() *FOO {
  28. p := new(FOO)
  29. *p = x
  30. return p
  31. }
  32. func (x FOO) String() string {
  33. return proto.EnumName(FOO_name, int32(x))
  34. }
  35. func (x *FOO) UnmarshalJSON(data []byte) error {
  36. value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO")
  37. if err != nil {
  38. return err
  39. }
  40. *x = FOO(value)
  41. return nil
  42. }
  43. type Test struct {
  44. Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"`
  45. Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"`
  46. Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"`
  47. Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"`
  48. XXX_unrecognized []byte `json:"-"`
  49. }
  50. func (m *Test) Reset() { *m = Test{} }
  51. func (m *Test) String() string { return proto.CompactTextString(m) }
  52. func (*Test) ProtoMessage() {}
  53. const Default_Test_Type int32 = 77
  54. func (m *Test) GetLabel() string {
  55. if m != nil && m.Label != nil {
  56. return *m.Label
  57. }
  58. return ""
  59. }
  60. func (m *Test) GetType() int32 {
  61. if m != nil && m.Type != nil {
  62. return *m.Type
  63. }
  64. return Default_Test_Type
  65. }
  66. func (m *Test) GetReps() []int64 {
  67. if m != nil {
  68. return m.Reps
  69. }
  70. return nil
  71. }
  72. func (m *Test) GetOptionalgroup() *Test_OptionalGroup {
  73. if m != nil {
  74. return m.Optionalgroup
  75. }
  76. return nil
  77. }
  78. type Test_OptionalGroup struct {
  79. RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"`
  80. XXX_unrecognized []byte `json:"-"`
  81. }
  82. func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} }
  83. func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) }
  84. func (*Test_OptionalGroup) ProtoMessage() {}
  85. func (m *Test_OptionalGroup) GetRequiredField() string {
  86. if m != nil && m.RequiredField != nil {
  87. return *m.RequiredField
  88. }
  89. return ""
  90. }
  91. func init() {
  92. proto.RegisterEnum("protoexample.FOO", FOO_name, FOO_value)
  93. }