initialise
[debian/goprotobuf.git] / compiler / testdata / test.pb.go.golden
1 // Code generated by protoc-gen-go from "test.proto"
2 // DO NOT EDIT!
3
4 package my_test
5
6 import proto "goprotobuf.googlecode.com/hg/proto"
7 import "math"
8 import "os"
9 import imp1 "imp.pb"
10 // discarding unused import multitest2 "multi1.pb"
11
12 // Reference proto, math & os imports to suppress error if they are not otherwise used.
13 var _ = proto.GetString
14 var _ = math.Inf
15 var _ os.Error
16
17 type HatType int32
18
19 const (
20         HatType_FEDORA HatType = 1
21         HatType_FEZ    HatType = 2
22 )
23
24 var HatType_name = map[int32]string{
25         1: "FEDORA",
26         2: "FEZ",
27 }
28 var HatType_value = map[string]int32{
29         "FEDORA": 1,
30         "FEZ":    2,
31 }
32
33 func NewHatType(x HatType) *HatType {
34         e := HatType(x)
35         return &e
36 }
37 func (x HatType) String() string {
38         return proto.EnumName(HatType_name, int32(x))
39 }
40
41 type Days int32
42
43 const (
44         Days_MONDAY  Days = 1
45         Days_TUESDAY Days = 2
46         Days_LUNDI   Days = 1
47 )
48
49 var Days_name = map[int32]string{
50         1: "MONDAY",
51         2: "TUESDAY",
52         // Duplicate value: 1: "LUNDI",
53 }
54 var Days_value = map[string]int32{
55         "MONDAY":  1,
56         "TUESDAY": 2,
57         "LUNDI":   1,
58 }
59
60 func NewDays(x Days) *Days {
61         e := Days(x)
62         return &e
63 }
64 func (x Days) String() string {
65         return proto.EnumName(Days_name, int32(x))
66 }
67
68 type Request_Color int32
69
70 const (
71         Request_RED   Request_Color = 0
72         Request_GREEN Request_Color = 1
73         Request_BLUE  Request_Color = 2
74 )
75
76 var Request_Color_name = map[int32]string{
77         0: "RED",
78         1: "GREEN",
79         2: "BLUE",
80 }
81 var Request_Color_value = map[string]int32{
82         "RED":   0,
83         "GREEN": 1,
84         "BLUE":  2,
85 }
86
87 func NewRequest_Color(x Request_Color) *Request_Color {
88         e := Request_Color(x)
89         return &e
90 }
91 func (x Request_Color) String() string {
92         return proto.EnumName(Request_Color_name, int32(x))
93 }
94
95 type Reply_Entry_Game int32
96
97 const (
98         Reply_Entry_FOOTBALL Reply_Entry_Game = 1
99         Reply_Entry_TENNIS   Reply_Entry_Game = 2
100 )
101
102 var Reply_Entry_Game_name = map[int32]string{
103         1: "FOOTBALL",
104         2: "TENNIS",
105 }
106 var Reply_Entry_Game_value = map[string]int32{
107         "FOOTBALL": 1,
108         "TENNIS":   2,
109 }
110
111 func NewReply_Entry_Game(x Reply_Entry_Game) *Reply_Entry_Game {
112         e := Reply_Entry_Game(x)
113         return &e
114 }
115 func (x Reply_Entry_Game) String() string {
116         return proto.EnumName(Reply_Entry_Game_name, int32(x))
117 }
118
119 type Request struct {
120         Key              []int64                     `protobuf:"varint,1,rep,name=key" json:"key,omitempty"`
121         ImportedMessage  *imp1.ImportedMessage       `protobuf:"bytes,2,opt,name=imported_message" json:"imported_message,omitempty"`
122         Hue              *Request_Color              `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"`
123         Hat              *HatType                    `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"`
124         Owner            *imp1.ImportedMessage_Owner `protobuf:"varint,6,opt,name=owner,enum=imp.ImportedMessage_Owner" json:"owner,omitempty"`
125         Deadline         *float32                    `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"`
126         Somegroup        *Request_SomeGroup          `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`
127         XXX_unrecognized []byte                      `json:",omitempty"`
128 }
129
130 func (this *Request) Reset()         { *this = Request{} }
131 func (this *Request) String() string { return proto.CompactTextString(this) }
132
133 const Default_Request_Hat HatType = HatType_FEDORA
134
135 var Default_Request_Deadline float32 = float32(math.Inf(1))
136
137 type Request_SomeGroup struct {
138         GroupField       *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"`
139         XXX_unrecognized []byte `json:",omitempty"`
140 }
141
142 func (this *Request_SomeGroup) Reset()         { *this = Request_SomeGroup{} }
143 func (this *Request_SomeGroup) String() string { return proto.CompactTextString(this) }
144
145 type Reply struct {
146         Found            []*Reply_Entry            `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"`
147         CompactKeys      []int32                   `protobuf:"varint,2,rep,packed,name=compact_keys" json:"compact_keys,omitempty"`
148         XXX_extensions   map[int32]proto.Extension `json:",omitempty"`
149         XXX_unrecognized []byte                    `json:",omitempty"`
150 }
151
152 func (this *Reply) Reset()         { *this = Reply{} }
153 func (this *Reply) String() string { return proto.CompactTextString(this) }
154
155 var extRange_Reply = []proto.ExtensionRange{
156         {100, 536870911},
157 }
158
159 func (*Reply) ExtensionRangeArray() []proto.ExtensionRange {
160         return extRange_Reply
161 }
162 func (this *Reply) ExtensionMap() map[int32]proto.Extension {
163         if this.XXX_extensions == nil {
164                 this.XXX_extensions = make(map[int32]proto.Extension)
165         }
166         return this.XXX_extensions
167 }
168
169 type Reply_Entry struct {
170         KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng" json:"key_that_needs_1234camel_CasIng,omitempty"`
171         Value                         *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"`
172         XMyFieldName_2                *int64 `protobuf:"varint,3,opt,name=_my_field_name_2" json:"_my_field_name_2,omitempty"`
173         XXX_unrecognized              []byte `json:",omitempty"`
174 }
175
176 func (this *Reply_Entry) Reset()         { *this = Reply_Entry{} }
177 func (this *Reply_Entry) String() string { return proto.CompactTextString(this) }
178
179 const Default_Reply_Entry_Value int64 = 7
180
181 type ReplyExtensions struct {
182         XXX_unrecognized []byte `json:",omitempty"`
183 }
184
185 func (this *ReplyExtensions) Reset()         { *this = ReplyExtensions{} }
186 func (this *ReplyExtensions) String() string { return proto.CompactTextString(this) }
187
188 var E_ReplyExtensions_Time = &proto.ExtensionDesc{
189         ExtendedType:  (*Reply)(nil),
190         ExtensionType: (*float64)(nil),
191         Field:         101,
192         Name:          "my_test.ReplyExtensions.time",
193         Tag:           "fixed64,101,opt,name=time",
194 }
195
196 type OldReply struct {
197         XXX_extensions   map[int32]proto.Extension `json:",omitempty"`
198         XXX_unrecognized []byte                    `json:",omitempty"`
199 }
200
201 func (this *OldReply) Reset()         { *this = OldReply{} }
202 func (this *OldReply) String() string { return proto.CompactTextString(this) }
203
204 func (this *OldReply) Marshal() ([]byte, os.Error) {
205         return proto.MarshalMessageSet(this.ExtensionMap())
206 }
207 func (this *OldReply) Unmarshal(buf []byte) os.Error {
208         return proto.UnmarshalMessageSet(buf, this.ExtensionMap())
209 }
210 // ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler
211 var _ proto.Marshaler = (*OldReply)(nil)
212 var _ proto.Unmarshaler = (*OldReply)(nil)
213
214 var extRange_OldReply = []proto.ExtensionRange{
215         {100, 536870911},
216 }
217
218 func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange {
219         return extRange_OldReply
220 }
221 func (this *OldReply) ExtensionMap() map[int32]proto.Extension {
222         if this.XXX_extensions == nil {
223                 this.XXX_extensions = make(map[int32]proto.Extension)
224         }
225         return this.XXX_extensions
226 }
227
228 var E_Tag = &proto.ExtensionDesc{
229         ExtendedType:  (*Reply)(nil),
230         ExtensionType: (*string)(nil),
231         Field:         103,
232         Name:          "my_test.tag",
233         Tag:           "bytes,103,opt,name=tag",
234 }
235
236 func init() {
237         proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value)
238         proto.RegisterEnum("my.test.Days", Days_name, Days_value)
239         proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value)
240         proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
241         proto.RegisterExtension(E_ReplyExtensions_Time)
242         proto.RegisterExtension(E_Tag)
243 }