1 // Copyright (c) 2012, Sean Treadway, SoundCloud Ltd.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 // Source code and contact info at http://github.com/streadway/amqp
6 /* GENERATED FILE - DO NOT EDIT */
7 /* Rebuild from the spec/gen.go tool */
17 // Error codes that can be sent from the server during a connection or
18 // channel exception or used by the client to indicate a class of error like
19 // ErrCredentials. The text of the error is likely more interesting than
32 ConnectionForced = 320
37 PreconditionFailed = 406
49 func isSoftExceptionCode(code int) bool {
70 type connectionStart struct {
73 ServerProperties Table
78 func (msg *connectionStart) id() (uint16, uint16) {
82 func (msg *connectionStart) wait() bool {
86 func (msg *connectionStart) write(w io.Writer) (err error) {
88 if err = binary.Write(w, binary.BigEndian, msg.VersionMajor); err != nil {
91 if err = binary.Write(w, binary.BigEndian, msg.VersionMinor); err != nil {
95 if err = writeTable(w, msg.ServerProperties); err != nil {
99 if err = writeLongstr(w, msg.Mechanisms); err != nil {
102 if err = writeLongstr(w, msg.Locales); err != nil {
109 func (msg *connectionStart) read(r io.Reader) (err error) {
111 if err = binary.Read(r, binary.BigEndian, &msg.VersionMajor); err != nil {
114 if err = binary.Read(r, binary.BigEndian, &msg.VersionMinor); err != nil {
118 if msg.ServerProperties, err = readTable(r); err != nil {
122 if msg.Mechanisms, err = readLongstr(r); err != nil {
125 if msg.Locales, err = readLongstr(r); err != nil {
132 type connectionStartOk struct {
133 ClientProperties Table
139 func (msg *connectionStartOk) id() (uint16, uint16) {
143 func (msg *connectionStartOk) wait() bool {
147 func (msg *connectionStartOk) write(w io.Writer) (err error) {
149 if err = writeTable(w, msg.ClientProperties); err != nil {
153 if err = writeShortstr(w, msg.Mechanism); err != nil {
157 if err = writeLongstr(w, msg.Response); err != nil {
161 if err = writeShortstr(w, msg.Locale); err != nil {
168 func (msg *connectionStartOk) read(r io.Reader) (err error) {
170 if msg.ClientProperties, err = readTable(r); err != nil {
174 if msg.Mechanism, err = readShortstr(r); err != nil {
178 if msg.Response, err = readLongstr(r); err != nil {
182 if msg.Locale, err = readShortstr(r); err != nil {
189 type connectionSecure struct {
193 func (msg *connectionSecure) id() (uint16, uint16) {
197 func (msg *connectionSecure) wait() bool {
201 func (msg *connectionSecure) write(w io.Writer) (err error) {
203 if err = writeLongstr(w, msg.Challenge); err != nil {
210 func (msg *connectionSecure) read(r io.Reader) (err error) {
212 if msg.Challenge, err = readLongstr(r); err != nil {
219 type connectionSecureOk struct {
223 func (msg *connectionSecureOk) id() (uint16, uint16) {
227 func (msg *connectionSecureOk) wait() bool {
231 func (msg *connectionSecureOk) write(w io.Writer) (err error) {
233 if err = writeLongstr(w, msg.Response); err != nil {
240 func (msg *connectionSecureOk) read(r io.Reader) (err error) {
242 if msg.Response, err = readLongstr(r); err != nil {
249 type connectionTune struct {
255 func (msg *connectionTune) id() (uint16, uint16) {
259 func (msg *connectionTune) wait() bool {
263 func (msg *connectionTune) write(w io.Writer) (err error) {
265 if err = binary.Write(w, binary.BigEndian, msg.ChannelMax); err != nil {
269 if err = binary.Write(w, binary.BigEndian, msg.FrameMax); err != nil {
273 if err = binary.Write(w, binary.BigEndian, msg.Heartbeat); err != nil {
280 func (msg *connectionTune) read(r io.Reader) (err error) {
282 if err = binary.Read(r, binary.BigEndian, &msg.ChannelMax); err != nil {
286 if err = binary.Read(r, binary.BigEndian, &msg.FrameMax); err != nil {
290 if err = binary.Read(r, binary.BigEndian, &msg.Heartbeat); err != nil {
297 type connectionTuneOk struct {
303 func (msg *connectionTuneOk) id() (uint16, uint16) {
307 func (msg *connectionTuneOk) wait() bool {
311 func (msg *connectionTuneOk) write(w io.Writer) (err error) {
313 if err = binary.Write(w, binary.BigEndian, msg.ChannelMax); err != nil {
317 if err = binary.Write(w, binary.BigEndian, msg.FrameMax); err != nil {
321 if err = binary.Write(w, binary.BigEndian, msg.Heartbeat); err != nil {
328 func (msg *connectionTuneOk) read(r io.Reader) (err error) {
330 if err = binary.Read(r, binary.BigEndian, &msg.ChannelMax); err != nil {
334 if err = binary.Read(r, binary.BigEndian, &msg.FrameMax); err != nil {
338 if err = binary.Read(r, binary.BigEndian, &msg.Heartbeat); err != nil {
345 type connectionOpen struct {
351 func (msg *connectionOpen) id() (uint16, uint16) {
355 func (msg *connectionOpen) wait() bool {
359 func (msg *connectionOpen) write(w io.Writer) (err error) {
362 if err = writeShortstr(w, msg.VirtualHost); err != nil {
365 if err = writeShortstr(w, msg.reserved1); err != nil {
373 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
380 func (msg *connectionOpen) read(r io.Reader) (err error) {
383 if msg.VirtualHost, err = readShortstr(r); err != nil {
386 if msg.reserved1, err = readShortstr(r); err != nil {
390 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
393 msg.reserved2 = (bits&(1<<0) > 0)
398 type connectionOpenOk struct {
402 func (msg *connectionOpenOk) id() (uint16, uint16) {
406 func (msg *connectionOpenOk) wait() bool {
410 func (msg *connectionOpenOk) write(w io.Writer) (err error) {
412 if err = writeShortstr(w, msg.reserved1); err != nil {
419 func (msg *connectionOpenOk) read(r io.Reader) (err error) {
421 if msg.reserved1, err = readShortstr(r); err != nil {
428 type connectionClose struct {
435 func (msg *connectionClose) id() (uint16, uint16) {
439 func (msg *connectionClose) wait() bool {
443 func (msg *connectionClose) write(w io.Writer) (err error) {
445 if err = binary.Write(w, binary.BigEndian, msg.ReplyCode); err != nil {
449 if err = writeShortstr(w, msg.ReplyText); err != nil {
453 if err = binary.Write(w, binary.BigEndian, msg.ClassId); err != nil {
456 if err = binary.Write(w, binary.BigEndian, msg.MethodId); err != nil {
463 func (msg *connectionClose) read(r io.Reader) (err error) {
465 if err = binary.Read(r, binary.BigEndian, &msg.ReplyCode); err != nil {
469 if msg.ReplyText, err = readShortstr(r); err != nil {
473 if err = binary.Read(r, binary.BigEndian, &msg.ClassId); err != nil {
476 if err = binary.Read(r, binary.BigEndian, &msg.MethodId); err != nil {
483 type connectionCloseOk struct {
486 func (msg *connectionCloseOk) id() (uint16, uint16) {
490 func (msg *connectionCloseOk) wait() bool {
494 func (msg *connectionCloseOk) write(w io.Writer) (err error) {
499 func (msg *connectionCloseOk) read(r io.Reader) (err error) {
504 type connectionBlocked struct {
508 func (msg *connectionBlocked) id() (uint16, uint16) {
512 func (msg *connectionBlocked) wait() bool {
516 func (msg *connectionBlocked) write(w io.Writer) (err error) {
518 if err = writeShortstr(w, msg.Reason); err != nil {
525 func (msg *connectionBlocked) read(r io.Reader) (err error) {
527 if msg.Reason, err = readShortstr(r); err != nil {
534 type connectionUnblocked struct {
537 func (msg *connectionUnblocked) id() (uint16, uint16) {
541 func (msg *connectionUnblocked) wait() bool {
545 func (msg *connectionUnblocked) write(w io.Writer) (err error) {
550 func (msg *connectionUnblocked) read(r io.Reader) (err error) {
555 type channelOpen struct {
559 func (msg *channelOpen) id() (uint16, uint16) {
563 func (msg *channelOpen) wait() bool {
567 func (msg *channelOpen) write(w io.Writer) (err error) {
569 if err = writeShortstr(w, msg.reserved1); err != nil {
576 func (msg *channelOpen) read(r io.Reader) (err error) {
578 if msg.reserved1, err = readShortstr(r); err != nil {
585 type channelOpenOk struct {
589 func (msg *channelOpenOk) id() (uint16, uint16) {
593 func (msg *channelOpenOk) wait() bool {
597 func (msg *channelOpenOk) write(w io.Writer) (err error) {
599 if err = writeLongstr(w, msg.reserved1); err != nil {
606 func (msg *channelOpenOk) read(r io.Reader) (err error) {
608 if msg.reserved1, err = readLongstr(r); err != nil {
615 type channelFlow struct {
619 func (msg *channelFlow) id() (uint16, uint16) {
623 func (msg *channelFlow) wait() bool {
627 func (msg *channelFlow) write(w io.Writer) (err error) {
634 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
641 func (msg *channelFlow) read(r io.Reader) (err error) {
644 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
647 msg.Active = (bits&(1<<0) > 0)
652 type channelFlowOk struct {
656 func (msg *channelFlowOk) id() (uint16, uint16) {
660 func (msg *channelFlowOk) wait() bool {
664 func (msg *channelFlowOk) write(w io.Writer) (err error) {
671 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
678 func (msg *channelFlowOk) read(r io.Reader) (err error) {
681 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
684 msg.Active = (bits&(1<<0) > 0)
689 type channelClose struct {
696 func (msg *channelClose) id() (uint16, uint16) {
700 func (msg *channelClose) wait() bool {
704 func (msg *channelClose) write(w io.Writer) (err error) {
706 if err = binary.Write(w, binary.BigEndian, msg.ReplyCode); err != nil {
710 if err = writeShortstr(w, msg.ReplyText); err != nil {
714 if err = binary.Write(w, binary.BigEndian, msg.ClassId); err != nil {
717 if err = binary.Write(w, binary.BigEndian, msg.MethodId); err != nil {
724 func (msg *channelClose) read(r io.Reader) (err error) {
726 if err = binary.Read(r, binary.BigEndian, &msg.ReplyCode); err != nil {
730 if msg.ReplyText, err = readShortstr(r); err != nil {
734 if err = binary.Read(r, binary.BigEndian, &msg.ClassId); err != nil {
737 if err = binary.Read(r, binary.BigEndian, &msg.MethodId); err != nil {
744 type channelCloseOk struct {
747 func (msg *channelCloseOk) id() (uint16, uint16) {
751 func (msg *channelCloseOk) wait() bool {
755 func (msg *channelCloseOk) write(w io.Writer) (err error) {
760 func (msg *channelCloseOk) read(r io.Reader) (err error) {
765 type exchangeDeclare struct {
777 func (msg *exchangeDeclare) id() (uint16, uint16) {
781 func (msg *exchangeDeclare) wait() bool {
782 return true && !msg.NoWait
785 func (msg *exchangeDeclare) write(w io.Writer) (err error) {
788 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
792 if err = writeShortstr(w, msg.Exchange); err != nil {
795 if err = writeShortstr(w, msg.Type); err != nil {
819 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
823 if err = writeTable(w, msg.Arguments); err != nil {
830 func (msg *exchangeDeclare) read(r io.Reader) (err error) {
833 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
837 if msg.Exchange, err = readShortstr(r); err != nil {
840 if msg.Type, err = readShortstr(r); err != nil {
844 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
847 msg.Passive = (bits&(1<<0) > 0)
848 msg.Durable = (bits&(1<<1) > 0)
849 msg.AutoDelete = (bits&(1<<2) > 0)
850 msg.Internal = (bits&(1<<3) > 0)
851 msg.NoWait = (bits&(1<<4) > 0)
853 if msg.Arguments, err = readTable(r); err != nil {
860 type exchangeDeclareOk struct {
863 func (msg *exchangeDeclareOk) id() (uint16, uint16) {
867 func (msg *exchangeDeclareOk) wait() bool {
871 func (msg *exchangeDeclareOk) write(w io.Writer) (err error) {
876 func (msg *exchangeDeclareOk) read(r io.Reader) (err error) {
881 type exchangeDelete struct {
888 func (msg *exchangeDelete) id() (uint16, uint16) {
892 func (msg *exchangeDelete) wait() bool {
893 return true && !msg.NoWait
896 func (msg *exchangeDelete) write(w io.Writer) (err error) {
899 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
903 if err = writeShortstr(w, msg.Exchange); err != nil {
915 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
922 func (msg *exchangeDelete) read(r io.Reader) (err error) {
925 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
929 if msg.Exchange, err = readShortstr(r); err != nil {
933 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
936 msg.IfUnused = (bits&(1<<0) > 0)
937 msg.NoWait = (bits&(1<<1) > 0)
942 type exchangeDeleteOk struct {
945 func (msg *exchangeDeleteOk) id() (uint16, uint16) {
949 func (msg *exchangeDeleteOk) wait() bool {
953 func (msg *exchangeDeleteOk) write(w io.Writer) (err error) {
958 func (msg *exchangeDeleteOk) read(r io.Reader) (err error) {
963 type exchangeBind struct {
972 func (msg *exchangeBind) id() (uint16, uint16) {
976 func (msg *exchangeBind) wait() bool {
977 return true && !msg.NoWait
980 func (msg *exchangeBind) write(w io.Writer) (err error) {
983 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
987 if err = writeShortstr(w, msg.Destination); err != nil {
990 if err = writeShortstr(w, msg.Source); err != nil {
993 if err = writeShortstr(w, msg.RoutingKey); err != nil {
1001 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1005 if err = writeTable(w, msg.Arguments); err != nil {
1012 func (msg *exchangeBind) read(r io.Reader) (err error) {
1015 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1019 if msg.Destination, err = readShortstr(r); err != nil {
1022 if msg.Source, err = readShortstr(r); err != nil {
1025 if msg.RoutingKey, err = readShortstr(r); err != nil {
1029 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1032 msg.NoWait = (bits&(1<<0) > 0)
1034 if msg.Arguments, err = readTable(r); err != nil {
1041 type exchangeBindOk struct {
1044 func (msg *exchangeBindOk) id() (uint16, uint16) {
1048 func (msg *exchangeBindOk) wait() bool {
1052 func (msg *exchangeBindOk) write(w io.Writer) (err error) {
1057 func (msg *exchangeBindOk) read(r io.Reader) (err error) {
1062 type exchangeUnbind struct {
1071 func (msg *exchangeUnbind) id() (uint16, uint16) {
1075 func (msg *exchangeUnbind) wait() bool {
1076 return true && !msg.NoWait
1079 func (msg *exchangeUnbind) write(w io.Writer) (err error) {
1082 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1086 if err = writeShortstr(w, msg.Destination); err != nil {
1089 if err = writeShortstr(w, msg.Source); err != nil {
1092 if err = writeShortstr(w, msg.RoutingKey); err != nil {
1100 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1104 if err = writeTable(w, msg.Arguments); err != nil {
1111 func (msg *exchangeUnbind) read(r io.Reader) (err error) {
1114 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1118 if msg.Destination, err = readShortstr(r); err != nil {
1121 if msg.Source, err = readShortstr(r); err != nil {
1124 if msg.RoutingKey, err = readShortstr(r); err != nil {
1128 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1131 msg.NoWait = (bits&(1<<0) > 0)
1133 if msg.Arguments, err = readTable(r); err != nil {
1140 type exchangeUnbindOk struct {
1143 func (msg *exchangeUnbindOk) id() (uint16, uint16) {
1147 func (msg *exchangeUnbindOk) wait() bool {
1151 func (msg *exchangeUnbindOk) write(w io.Writer) (err error) {
1156 func (msg *exchangeUnbindOk) read(r io.Reader) (err error) {
1161 type queueDeclare struct {
1172 func (msg *queueDeclare) id() (uint16, uint16) {
1176 func (msg *queueDeclare) wait() bool {
1177 return true && !msg.NoWait
1180 func (msg *queueDeclare) write(w io.Writer) (err error) {
1183 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1187 if err = writeShortstr(w, msg.Queue); err != nil {
1211 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1215 if err = writeTable(w, msg.Arguments); err != nil {
1222 func (msg *queueDeclare) read(r io.Reader) (err error) {
1225 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1229 if msg.Queue, err = readShortstr(r); err != nil {
1233 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1236 msg.Passive = (bits&(1<<0) > 0)
1237 msg.Durable = (bits&(1<<1) > 0)
1238 msg.Exclusive = (bits&(1<<2) > 0)
1239 msg.AutoDelete = (bits&(1<<3) > 0)
1240 msg.NoWait = (bits&(1<<4) > 0)
1242 if msg.Arguments, err = readTable(r); err != nil {
1249 type queueDeclareOk struct {
1252 ConsumerCount uint32
1255 func (msg *queueDeclareOk) id() (uint16, uint16) {
1259 func (msg *queueDeclareOk) wait() bool {
1263 func (msg *queueDeclareOk) write(w io.Writer) (err error) {
1265 if err = writeShortstr(w, msg.Queue); err != nil {
1269 if err = binary.Write(w, binary.BigEndian, msg.MessageCount); err != nil {
1272 if err = binary.Write(w, binary.BigEndian, msg.ConsumerCount); err != nil {
1279 func (msg *queueDeclareOk) read(r io.Reader) (err error) {
1281 if msg.Queue, err = readShortstr(r); err != nil {
1285 if err = binary.Read(r, binary.BigEndian, &msg.MessageCount); err != nil {
1288 if err = binary.Read(r, binary.BigEndian, &msg.ConsumerCount); err != nil {
1295 type queueBind struct {
1304 func (msg *queueBind) id() (uint16, uint16) {
1308 func (msg *queueBind) wait() bool {
1309 return true && !msg.NoWait
1312 func (msg *queueBind) write(w io.Writer) (err error) {
1315 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1319 if err = writeShortstr(w, msg.Queue); err != nil {
1322 if err = writeShortstr(w, msg.Exchange); err != nil {
1325 if err = writeShortstr(w, msg.RoutingKey); err != nil {
1333 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1337 if err = writeTable(w, msg.Arguments); err != nil {
1344 func (msg *queueBind) read(r io.Reader) (err error) {
1347 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1351 if msg.Queue, err = readShortstr(r); err != nil {
1354 if msg.Exchange, err = readShortstr(r); err != nil {
1357 if msg.RoutingKey, err = readShortstr(r); err != nil {
1361 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1364 msg.NoWait = (bits&(1<<0) > 0)
1366 if msg.Arguments, err = readTable(r); err != nil {
1373 type queueBindOk struct {
1376 func (msg *queueBindOk) id() (uint16, uint16) {
1380 func (msg *queueBindOk) wait() bool {
1384 func (msg *queueBindOk) write(w io.Writer) (err error) {
1389 func (msg *queueBindOk) read(r io.Reader) (err error) {
1394 type queueUnbind struct {
1402 func (msg *queueUnbind) id() (uint16, uint16) {
1406 func (msg *queueUnbind) wait() bool {
1410 func (msg *queueUnbind) write(w io.Writer) (err error) {
1412 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1416 if err = writeShortstr(w, msg.Queue); err != nil {
1419 if err = writeShortstr(w, msg.Exchange); err != nil {
1422 if err = writeShortstr(w, msg.RoutingKey); err != nil {
1426 if err = writeTable(w, msg.Arguments); err != nil {
1433 func (msg *queueUnbind) read(r io.Reader) (err error) {
1435 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1439 if msg.Queue, err = readShortstr(r); err != nil {
1442 if msg.Exchange, err = readShortstr(r); err != nil {
1445 if msg.RoutingKey, err = readShortstr(r); err != nil {
1449 if msg.Arguments, err = readTable(r); err != nil {
1456 type queueUnbindOk struct {
1459 func (msg *queueUnbindOk) id() (uint16, uint16) {
1463 func (msg *queueUnbindOk) wait() bool {
1467 func (msg *queueUnbindOk) write(w io.Writer) (err error) {
1472 func (msg *queueUnbindOk) read(r io.Reader) (err error) {
1477 type queuePurge struct {
1483 func (msg *queuePurge) id() (uint16, uint16) {
1487 func (msg *queuePurge) wait() bool {
1488 return true && !msg.NoWait
1491 func (msg *queuePurge) write(w io.Writer) (err error) {
1494 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1498 if err = writeShortstr(w, msg.Queue); err != nil {
1506 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1513 func (msg *queuePurge) read(r io.Reader) (err error) {
1516 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1520 if msg.Queue, err = readShortstr(r); err != nil {
1524 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1527 msg.NoWait = (bits&(1<<0) > 0)
1532 type queuePurgeOk struct {
1536 func (msg *queuePurgeOk) id() (uint16, uint16) {
1540 func (msg *queuePurgeOk) wait() bool {
1544 func (msg *queuePurgeOk) write(w io.Writer) (err error) {
1546 if err = binary.Write(w, binary.BigEndian, msg.MessageCount); err != nil {
1553 func (msg *queuePurgeOk) read(r io.Reader) (err error) {
1555 if err = binary.Read(r, binary.BigEndian, &msg.MessageCount); err != nil {
1562 type queueDelete struct {
1570 func (msg *queueDelete) id() (uint16, uint16) {
1574 func (msg *queueDelete) wait() bool {
1575 return true && !msg.NoWait
1578 func (msg *queueDelete) write(w io.Writer) (err error) {
1581 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1585 if err = writeShortstr(w, msg.Queue); err != nil {
1601 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1608 func (msg *queueDelete) read(r io.Reader) (err error) {
1611 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1615 if msg.Queue, err = readShortstr(r); err != nil {
1619 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1622 msg.IfUnused = (bits&(1<<0) > 0)
1623 msg.IfEmpty = (bits&(1<<1) > 0)
1624 msg.NoWait = (bits&(1<<2) > 0)
1629 type queueDeleteOk struct {
1633 func (msg *queueDeleteOk) id() (uint16, uint16) {
1637 func (msg *queueDeleteOk) wait() bool {
1641 func (msg *queueDeleteOk) write(w io.Writer) (err error) {
1643 if err = binary.Write(w, binary.BigEndian, msg.MessageCount); err != nil {
1650 func (msg *queueDeleteOk) read(r io.Reader) (err error) {
1652 if err = binary.Read(r, binary.BigEndian, &msg.MessageCount); err != nil {
1659 type basicQos struct {
1661 PrefetchCount uint16
1665 func (msg *basicQos) id() (uint16, uint16) {
1669 func (msg *basicQos) wait() bool {
1673 func (msg *basicQos) write(w io.Writer) (err error) {
1676 if err = binary.Write(w, binary.BigEndian, msg.PrefetchSize); err != nil {
1680 if err = binary.Write(w, binary.BigEndian, msg.PrefetchCount); err != nil {
1688 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1695 func (msg *basicQos) read(r io.Reader) (err error) {
1698 if err = binary.Read(r, binary.BigEndian, &msg.PrefetchSize); err != nil {
1702 if err = binary.Read(r, binary.BigEndian, &msg.PrefetchCount); err != nil {
1706 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1709 msg.Global = (bits&(1<<0) > 0)
1714 type basicQosOk struct {
1717 func (msg *basicQosOk) id() (uint16, uint16) {
1721 func (msg *basicQosOk) wait() bool {
1725 func (msg *basicQosOk) write(w io.Writer) (err error) {
1730 func (msg *basicQosOk) read(r io.Reader) (err error) {
1735 type basicConsume struct {
1746 func (msg *basicConsume) id() (uint16, uint16) {
1750 func (msg *basicConsume) wait() bool {
1751 return true && !msg.NoWait
1754 func (msg *basicConsume) write(w io.Writer) (err error) {
1757 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1761 if err = writeShortstr(w, msg.Queue); err != nil {
1764 if err = writeShortstr(w, msg.ConsumerTag); err != nil {
1784 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1788 if err = writeTable(w, msg.Arguments); err != nil {
1795 func (msg *basicConsume) read(r io.Reader) (err error) {
1798 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1802 if msg.Queue, err = readShortstr(r); err != nil {
1805 if msg.ConsumerTag, err = readShortstr(r); err != nil {
1809 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1812 msg.NoLocal = (bits&(1<<0) > 0)
1813 msg.NoAck = (bits&(1<<1) > 0)
1814 msg.Exclusive = (bits&(1<<2) > 0)
1815 msg.NoWait = (bits&(1<<3) > 0)
1817 if msg.Arguments, err = readTable(r); err != nil {
1824 type basicConsumeOk struct {
1828 func (msg *basicConsumeOk) id() (uint16, uint16) {
1832 func (msg *basicConsumeOk) wait() bool {
1836 func (msg *basicConsumeOk) write(w io.Writer) (err error) {
1838 if err = writeShortstr(w, msg.ConsumerTag); err != nil {
1845 func (msg *basicConsumeOk) read(r io.Reader) (err error) {
1847 if msg.ConsumerTag, err = readShortstr(r); err != nil {
1854 type basicCancel struct {
1859 func (msg *basicCancel) id() (uint16, uint16) {
1863 func (msg *basicCancel) wait() bool {
1864 return true && !msg.NoWait
1867 func (msg *basicCancel) write(w io.Writer) (err error) {
1870 if err = writeShortstr(w, msg.ConsumerTag); err != nil {
1878 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1885 func (msg *basicCancel) read(r io.Reader) (err error) {
1888 if msg.ConsumerTag, err = readShortstr(r); err != nil {
1892 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
1895 msg.NoWait = (bits&(1<<0) > 0)
1900 type basicCancelOk struct {
1904 func (msg *basicCancelOk) id() (uint16, uint16) {
1908 func (msg *basicCancelOk) wait() bool {
1912 func (msg *basicCancelOk) write(w io.Writer) (err error) {
1914 if err = writeShortstr(w, msg.ConsumerTag); err != nil {
1921 func (msg *basicCancelOk) read(r io.Reader) (err error) {
1923 if msg.ConsumerTag, err = readShortstr(r); err != nil {
1930 type basicPublish struct {
1936 Properties properties
1940 func (msg *basicPublish) id() (uint16, uint16) {
1944 func (msg *basicPublish) wait() bool {
1948 func (msg *basicPublish) getContent() (properties, []byte) {
1949 return msg.Properties, msg.Body
1952 func (msg *basicPublish) setContent(props properties, body []byte) {
1953 msg.Properties, msg.Body = props, body
1956 func (msg *basicPublish) write(w io.Writer) (err error) {
1959 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
1963 if err = writeShortstr(w, msg.Exchange); err != nil {
1966 if err = writeShortstr(w, msg.RoutingKey); err != nil {
1978 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
1985 func (msg *basicPublish) read(r io.Reader) (err error) {
1988 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
1992 if msg.Exchange, err = readShortstr(r); err != nil {
1995 if msg.RoutingKey, err = readShortstr(r); err != nil {
1999 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2002 msg.Mandatory = (bits&(1<<0) > 0)
2003 msg.Immediate = (bits&(1<<1) > 0)
2008 type basicReturn struct {
2013 Properties properties
2017 func (msg *basicReturn) id() (uint16, uint16) {
2021 func (msg *basicReturn) wait() bool {
2025 func (msg *basicReturn) getContent() (properties, []byte) {
2026 return msg.Properties, msg.Body
2029 func (msg *basicReturn) setContent(props properties, body []byte) {
2030 msg.Properties, msg.Body = props, body
2033 func (msg *basicReturn) write(w io.Writer) (err error) {
2035 if err = binary.Write(w, binary.BigEndian, msg.ReplyCode); err != nil {
2039 if err = writeShortstr(w, msg.ReplyText); err != nil {
2042 if err = writeShortstr(w, msg.Exchange); err != nil {
2045 if err = writeShortstr(w, msg.RoutingKey); err != nil {
2052 func (msg *basicReturn) read(r io.Reader) (err error) {
2054 if err = binary.Read(r, binary.BigEndian, &msg.ReplyCode); err != nil {
2058 if msg.ReplyText, err = readShortstr(r); err != nil {
2061 if msg.Exchange, err = readShortstr(r); err != nil {
2064 if msg.RoutingKey, err = readShortstr(r); err != nil {
2071 type basicDeliver struct {
2077 Properties properties
2081 func (msg *basicDeliver) id() (uint16, uint16) {
2085 func (msg *basicDeliver) wait() bool {
2089 func (msg *basicDeliver) getContent() (properties, []byte) {
2090 return msg.Properties, msg.Body
2093 func (msg *basicDeliver) setContent(props properties, body []byte) {
2094 msg.Properties, msg.Body = props, body
2097 func (msg *basicDeliver) write(w io.Writer) (err error) {
2100 if err = writeShortstr(w, msg.ConsumerTag); err != nil {
2104 if err = binary.Write(w, binary.BigEndian, msg.DeliveryTag); err != nil {
2108 if msg.Redelivered {
2112 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2116 if err = writeShortstr(w, msg.Exchange); err != nil {
2119 if err = writeShortstr(w, msg.RoutingKey); err != nil {
2126 func (msg *basicDeliver) read(r io.Reader) (err error) {
2129 if msg.ConsumerTag, err = readShortstr(r); err != nil {
2133 if err = binary.Read(r, binary.BigEndian, &msg.DeliveryTag); err != nil {
2137 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2140 msg.Redelivered = (bits&(1<<0) > 0)
2142 if msg.Exchange, err = readShortstr(r); err != nil {
2145 if msg.RoutingKey, err = readShortstr(r); err != nil {
2152 type basicGet struct {
2158 func (msg *basicGet) id() (uint16, uint16) {
2162 func (msg *basicGet) wait() bool {
2166 func (msg *basicGet) write(w io.Writer) (err error) {
2169 if err = binary.Write(w, binary.BigEndian, msg.reserved1); err != nil {
2173 if err = writeShortstr(w, msg.Queue); err != nil {
2181 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2188 func (msg *basicGet) read(r io.Reader) (err error) {
2191 if err = binary.Read(r, binary.BigEndian, &msg.reserved1); err != nil {
2195 if msg.Queue, err = readShortstr(r); err != nil {
2199 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2202 msg.NoAck = (bits&(1<<0) > 0)
2207 type basicGetOk struct {
2213 Properties properties
2217 func (msg *basicGetOk) id() (uint16, uint16) {
2221 func (msg *basicGetOk) wait() bool {
2225 func (msg *basicGetOk) getContent() (properties, []byte) {
2226 return msg.Properties, msg.Body
2229 func (msg *basicGetOk) setContent(props properties, body []byte) {
2230 msg.Properties, msg.Body = props, body
2233 func (msg *basicGetOk) write(w io.Writer) (err error) {
2236 if err = binary.Write(w, binary.BigEndian, msg.DeliveryTag); err != nil {
2240 if msg.Redelivered {
2244 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2248 if err = writeShortstr(w, msg.Exchange); err != nil {
2251 if err = writeShortstr(w, msg.RoutingKey); err != nil {
2255 if err = binary.Write(w, binary.BigEndian, msg.MessageCount); err != nil {
2262 func (msg *basicGetOk) read(r io.Reader) (err error) {
2265 if err = binary.Read(r, binary.BigEndian, &msg.DeliveryTag); err != nil {
2269 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2272 msg.Redelivered = (bits&(1<<0) > 0)
2274 if msg.Exchange, err = readShortstr(r); err != nil {
2277 if msg.RoutingKey, err = readShortstr(r); err != nil {
2281 if err = binary.Read(r, binary.BigEndian, &msg.MessageCount); err != nil {
2288 type basicGetEmpty struct {
2292 func (msg *basicGetEmpty) id() (uint16, uint16) {
2296 func (msg *basicGetEmpty) wait() bool {
2300 func (msg *basicGetEmpty) write(w io.Writer) (err error) {
2302 if err = writeShortstr(w, msg.reserved1); err != nil {
2309 func (msg *basicGetEmpty) read(r io.Reader) (err error) {
2311 if msg.reserved1, err = readShortstr(r); err != nil {
2318 type basicAck struct {
2323 func (msg *basicAck) id() (uint16, uint16) {
2327 func (msg *basicAck) wait() bool {
2331 func (msg *basicAck) write(w io.Writer) (err error) {
2334 if err = binary.Write(w, binary.BigEndian, msg.DeliveryTag); err != nil {
2342 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2349 func (msg *basicAck) read(r io.Reader) (err error) {
2352 if err = binary.Read(r, binary.BigEndian, &msg.DeliveryTag); err != nil {
2356 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2359 msg.Multiple = (bits&(1<<0) > 0)
2364 type basicReject struct {
2369 func (msg *basicReject) id() (uint16, uint16) {
2373 func (msg *basicReject) wait() bool {
2377 func (msg *basicReject) write(w io.Writer) (err error) {
2380 if err = binary.Write(w, binary.BigEndian, msg.DeliveryTag); err != nil {
2388 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2395 func (msg *basicReject) read(r io.Reader) (err error) {
2398 if err = binary.Read(r, binary.BigEndian, &msg.DeliveryTag); err != nil {
2402 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2405 msg.Requeue = (bits&(1<<0) > 0)
2410 type basicRecoverAsync struct {
2414 func (msg *basicRecoverAsync) id() (uint16, uint16) {
2418 func (msg *basicRecoverAsync) wait() bool {
2422 func (msg *basicRecoverAsync) write(w io.Writer) (err error) {
2429 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2436 func (msg *basicRecoverAsync) read(r io.Reader) (err error) {
2439 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2442 msg.Requeue = (bits&(1<<0) > 0)
2447 type basicRecover struct {
2451 func (msg *basicRecover) id() (uint16, uint16) {
2455 func (msg *basicRecover) wait() bool {
2459 func (msg *basicRecover) write(w io.Writer) (err error) {
2466 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2473 func (msg *basicRecover) read(r io.Reader) (err error) {
2476 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2479 msg.Requeue = (bits&(1<<0) > 0)
2484 type basicRecoverOk struct {
2487 func (msg *basicRecoverOk) id() (uint16, uint16) {
2491 func (msg *basicRecoverOk) wait() bool {
2495 func (msg *basicRecoverOk) write(w io.Writer) (err error) {
2500 func (msg *basicRecoverOk) read(r io.Reader) (err error) {
2505 type basicNack struct {
2511 func (msg *basicNack) id() (uint16, uint16) {
2515 func (msg *basicNack) wait() bool {
2519 func (msg *basicNack) write(w io.Writer) (err error) {
2522 if err = binary.Write(w, binary.BigEndian, msg.DeliveryTag); err != nil {
2534 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2541 func (msg *basicNack) read(r io.Reader) (err error) {
2544 if err = binary.Read(r, binary.BigEndian, &msg.DeliveryTag); err != nil {
2548 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2551 msg.Multiple = (bits&(1<<0) > 0)
2552 msg.Requeue = (bits&(1<<1) > 0)
2557 type txSelect struct {
2560 func (msg *txSelect) id() (uint16, uint16) {
2564 func (msg *txSelect) wait() bool {
2568 func (msg *txSelect) write(w io.Writer) (err error) {
2573 func (msg *txSelect) read(r io.Reader) (err error) {
2578 type txSelectOk struct {
2581 func (msg *txSelectOk) id() (uint16, uint16) {
2585 func (msg *txSelectOk) wait() bool {
2589 func (msg *txSelectOk) write(w io.Writer) (err error) {
2594 func (msg *txSelectOk) read(r io.Reader) (err error) {
2599 type txCommit struct {
2602 func (msg *txCommit) id() (uint16, uint16) {
2606 func (msg *txCommit) wait() bool {
2610 func (msg *txCommit) write(w io.Writer) (err error) {
2615 func (msg *txCommit) read(r io.Reader) (err error) {
2620 type txCommitOk struct {
2623 func (msg *txCommitOk) id() (uint16, uint16) {
2627 func (msg *txCommitOk) wait() bool {
2631 func (msg *txCommitOk) write(w io.Writer) (err error) {
2636 func (msg *txCommitOk) read(r io.Reader) (err error) {
2641 type txRollback struct {
2644 func (msg *txRollback) id() (uint16, uint16) {
2648 func (msg *txRollback) wait() bool {
2652 func (msg *txRollback) write(w io.Writer) (err error) {
2657 func (msg *txRollback) read(r io.Reader) (err error) {
2662 type txRollbackOk struct {
2665 func (msg *txRollbackOk) id() (uint16, uint16) {
2669 func (msg *txRollbackOk) wait() bool {
2673 func (msg *txRollbackOk) write(w io.Writer) (err error) {
2678 func (msg *txRollbackOk) read(r io.Reader) (err error) {
2683 type confirmSelect struct {
2687 func (msg *confirmSelect) id() (uint16, uint16) {
2691 func (msg *confirmSelect) wait() bool {
2695 func (msg *confirmSelect) write(w io.Writer) (err error) {
2702 if err = binary.Write(w, binary.BigEndian, bits); err != nil {
2709 func (msg *confirmSelect) read(r io.Reader) (err error) {
2712 if err = binary.Read(r, binary.BigEndian, &bits); err != nil {
2715 msg.Nowait = (bits&(1<<0) > 0)
2720 type confirmSelectOk struct {
2723 func (msg *confirmSelectOk) id() (uint16, uint16) {
2727 func (msg *confirmSelectOk) wait() bool {
2731 func (msg *confirmSelectOk) write(w io.Writer) (err error) {
2736 func (msg *confirmSelectOk) read(r io.Reader) (err error) {
2741 func (r *reader) parseMethodFrame(channel uint16, size uint32) (f frame, err error) {
2746 if err = binary.Read(r.r, binary.BigEndian, &mf.ClassId); err != nil {
2750 if err = binary.Read(r.r, binary.BigEndian, &mf.MethodId); err != nil {
2756 case 10: // connection
2757 switch mf.MethodId {
2759 case 10: // connection start
2760 //fmt.Println("NextMethod: class:10 method:10")
2761 method := &connectionStart{}
2762 if err = method.read(r.r); err != nil {
2767 case 11: // connection start-ok
2768 //fmt.Println("NextMethod: class:10 method:11")
2769 method := &connectionStartOk{}
2770 if err = method.read(r.r); err != nil {
2775 case 20: // connection secure
2776 //fmt.Println("NextMethod: class:10 method:20")
2777 method := &connectionSecure{}
2778 if err = method.read(r.r); err != nil {
2783 case 21: // connection secure-ok
2784 //fmt.Println("NextMethod: class:10 method:21")
2785 method := &connectionSecureOk{}
2786 if err = method.read(r.r); err != nil {
2791 case 30: // connection tune
2792 //fmt.Println("NextMethod: class:10 method:30")
2793 method := &connectionTune{}
2794 if err = method.read(r.r); err != nil {
2799 case 31: // connection tune-ok
2800 //fmt.Println("NextMethod: class:10 method:31")
2801 method := &connectionTuneOk{}
2802 if err = method.read(r.r); err != nil {
2807 case 40: // connection open
2808 //fmt.Println("NextMethod: class:10 method:40")
2809 method := &connectionOpen{}
2810 if err = method.read(r.r); err != nil {
2815 case 41: // connection open-ok
2816 //fmt.Println("NextMethod: class:10 method:41")
2817 method := &connectionOpenOk{}
2818 if err = method.read(r.r); err != nil {
2823 case 50: // connection close
2824 //fmt.Println("NextMethod: class:10 method:50")
2825 method := &connectionClose{}
2826 if err = method.read(r.r); err != nil {
2831 case 51: // connection close-ok
2832 //fmt.Println("NextMethod: class:10 method:51")
2833 method := &connectionCloseOk{}
2834 if err = method.read(r.r); err != nil {
2839 case 60: // connection blocked
2840 //fmt.Println("NextMethod: class:10 method:60")
2841 method := &connectionBlocked{}
2842 if err = method.read(r.r); err != nil {
2847 case 61: // connection unblocked
2848 //fmt.Println("NextMethod: class:10 method:61")
2849 method := &connectionUnblocked{}
2850 if err = method.read(r.r); err != nil {
2856 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
2860 switch mf.MethodId {
2862 case 10: // channel open
2863 //fmt.Println("NextMethod: class:20 method:10")
2864 method := &channelOpen{}
2865 if err = method.read(r.r); err != nil {
2870 case 11: // channel open-ok
2871 //fmt.Println("NextMethod: class:20 method:11")
2872 method := &channelOpenOk{}
2873 if err = method.read(r.r); err != nil {
2878 case 20: // channel flow
2879 //fmt.Println("NextMethod: class:20 method:20")
2880 method := &channelFlow{}
2881 if err = method.read(r.r); err != nil {
2886 case 21: // channel flow-ok
2887 //fmt.Println("NextMethod: class:20 method:21")
2888 method := &channelFlowOk{}
2889 if err = method.read(r.r); err != nil {
2894 case 40: // channel close
2895 //fmt.Println("NextMethod: class:20 method:40")
2896 method := &channelClose{}
2897 if err = method.read(r.r); err != nil {
2902 case 41: // channel close-ok
2903 //fmt.Println("NextMethod: class:20 method:41")
2904 method := &channelCloseOk{}
2905 if err = method.read(r.r); err != nil {
2911 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
2914 case 40: // exchange
2915 switch mf.MethodId {
2917 case 10: // exchange declare
2918 //fmt.Println("NextMethod: class:40 method:10")
2919 method := &exchangeDeclare{}
2920 if err = method.read(r.r); err != nil {
2925 case 11: // exchange declare-ok
2926 //fmt.Println("NextMethod: class:40 method:11")
2927 method := &exchangeDeclareOk{}
2928 if err = method.read(r.r); err != nil {
2933 case 20: // exchange delete
2934 //fmt.Println("NextMethod: class:40 method:20")
2935 method := &exchangeDelete{}
2936 if err = method.read(r.r); err != nil {
2941 case 21: // exchange delete-ok
2942 //fmt.Println("NextMethod: class:40 method:21")
2943 method := &exchangeDeleteOk{}
2944 if err = method.read(r.r); err != nil {
2949 case 30: // exchange bind
2950 //fmt.Println("NextMethod: class:40 method:30")
2951 method := &exchangeBind{}
2952 if err = method.read(r.r); err != nil {
2957 case 31: // exchange bind-ok
2958 //fmt.Println("NextMethod: class:40 method:31")
2959 method := &exchangeBindOk{}
2960 if err = method.read(r.r); err != nil {
2965 case 40: // exchange unbind
2966 //fmt.Println("NextMethod: class:40 method:40")
2967 method := &exchangeUnbind{}
2968 if err = method.read(r.r); err != nil {
2973 case 51: // exchange unbind-ok
2974 //fmt.Println("NextMethod: class:40 method:51")
2975 method := &exchangeUnbindOk{}
2976 if err = method.read(r.r); err != nil {
2982 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
2986 switch mf.MethodId {
2988 case 10: // queue declare
2989 //fmt.Println("NextMethod: class:50 method:10")
2990 method := &queueDeclare{}
2991 if err = method.read(r.r); err != nil {
2996 case 11: // queue declare-ok
2997 //fmt.Println("NextMethod: class:50 method:11")
2998 method := &queueDeclareOk{}
2999 if err = method.read(r.r); err != nil {
3004 case 20: // queue bind
3005 //fmt.Println("NextMethod: class:50 method:20")
3006 method := &queueBind{}
3007 if err = method.read(r.r); err != nil {
3012 case 21: // queue bind-ok
3013 //fmt.Println("NextMethod: class:50 method:21")
3014 method := &queueBindOk{}
3015 if err = method.read(r.r); err != nil {
3020 case 50: // queue unbind
3021 //fmt.Println("NextMethod: class:50 method:50")
3022 method := &queueUnbind{}
3023 if err = method.read(r.r); err != nil {
3028 case 51: // queue unbind-ok
3029 //fmt.Println("NextMethod: class:50 method:51")
3030 method := &queueUnbindOk{}
3031 if err = method.read(r.r); err != nil {
3036 case 30: // queue purge
3037 //fmt.Println("NextMethod: class:50 method:30")
3038 method := &queuePurge{}
3039 if err = method.read(r.r); err != nil {
3044 case 31: // queue purge-ok
3045 //fmt.Println("NextMethod: class:50 method:31")
3046 method := &queuePurgeOk{}
3047 if err = method.read(r.r); err != nil {
3052 case 40: // queue delete
3053 //fmt.Println("NextMethod: class:50 method:40")
3054 method := &queueDelete{}
3055 if err = method.read(r.r); err != nil {
3060 case 41: // queue delete-ok
3061 //fmt.Println("NextMethod: class:50 method:41")
3062 method := &queueDeleteOk{}
3063 if err = method.read(r.r); err != nil {
3069 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
3073 switch mf.MethodId {
3075 case 10: // basic qos
3076 //fmt.Println("NextMethod: class:60 method:10")
3077 method := &basicQos{}
3078 if err = method.read(r.r); err != nil {
3083 case 11: // basic qos-ok
3084 //fmt.Println("NextMethod: class:60 method:11")
3085 method := &basicQosOk{}
3086 if err = method.read(r.r); err != nil {
3091 case 20: // basic consume
3092 //fmt.Println("NextMethod: class:60 method:20")
3093 method := &basicConsume{}
3094 if err = method.read(r.r); err != nil {
3099 case 21: // basic consume-ok
3100 //fmt.Println("NextMethod: class:60 method:21")
3101 method := &basicConsumeOk{}
3102 if err = method.read(r.r); err != nil {
3107 case 30: // basic cancel
3108 //fmt.Println("NextMethod: class:60 method:30")
3109 method := &basicCancel{}
3110 if err = method.read(r.r); err != nil {
3115 case 31: // basic cancel-ok
3116 //fmt.Println("NextMethod: class:60 method:31")
3117 method := &basicCancelOk{}
3118 if err = method.read(r.r); err != nil {
3123 case 40: // basic publish
3124 //fmt.Println("NextMethod: class:60 method:40")
3125 method := &basicPublish{}
3126 if err = method.read(r.r); err != nil {
3131 case 50: // basic return
3132 //fmt.Println("NextMethod: class:60 method:50")
3133 method := &basicReturn{}
3134 if err = method.read(r.r); err != nil {
3139 case 60: // basic deliver
3140 //fmt.Println("NextMethod: class:60 method:60")
3141 method := &basicDeliver{}
3142 if err = method.read(r.r); err != nil {
3147 case 70: // basic get
3148 //fmt.Println("NextMethod: class:60 method:70")
3149 method := &basicGet{}
3150 if err = method.read(r.r); err != nil {
3155 case 71: // basic get-ok
3156 //fmt.Println("NextMethod: class:60 method:71")
3157 method := &basicGetOk{}
3158 if err = method.read(r.r); err != nil {
3163 case 72: // basic get-empty
3164 //fmt.Println("NextMethod: class:60 method:72")
3165 method := &basicGetEmpty{}
3166 if err = method.read(r.r); err != nil {
3171 case 80: // basic ack
3172 //fmt.Println("NextMethod: class:60 method:80")
3173 method := &basicAck{}
3174 if err = method.read(r.r); err != nil {
3179 case 90: // basic reject
3180 //fmt.Println("NextMethod: class:60 method:90")
3181 method := &basicReject{}
3182 if err = method.read(r.r); err != nil {
3187 case 100: // basic recover-async
3188 //fmt.Println("NextMethod: class:60 method:100")
3189 method := &basicRecoverAsync{}
3190 if err = method.read(r.r); err != nil {
3195 case 110: // basic recover
3196 //fmt.Println("NextMethod: class:60 method:110")
3197 method := &basicRecover{}
3198 if err = method.read(r.r); err != nil {
3203 case 111: // basic recover-ok
3204 //fmt.Println("NextMethod: class:60 method:111")
3205 method := &basicRecoverOk{}
3206 if err = method.read(r.r); err != nil {
3211 case 120: // basic nack
3212 //fmt.Println("NextMethod: class:60 method:120")
3213 method := &basicNack{}
3214 if err = method.read(r.r); err != nil {
3220 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
3224 switch mf.MethodId {
3226 case 10: // tx select
3227 //fmt.Println("NextMethod: class:90 method:10")
3228 method := &txSelect{}
3229 if err = method.read(r.r); err != nil {
3234 case 11: // tx select-ok
3235 //fmt.Println("NextMethod: class:90 method:11")
3236 method := &txSelectOk{}
3237 if err = method.read(r.r); err != nil {
3242 case 20: // tx commit
3243 //fmt.Println("NextMethod: class:90 method:20")
3244 method := &txCommit{}
3245 if err = method.read(r.r); err != nil {
3250 case 21: // tx commit-ok
3251 //fmt.Println("NextMethod: class:90 method:21")
3252 method := &txCommitOk{}
3253 if err = method.read(r.r); err != nil {
3258 case 30: // tx rollback
3259 //fmt.Println("NextMethod: class:90 method:30")
3260 method := &txRollback{}
3261 if err = method.read(r.r); err != nil {
3266 case 31: // tx rollback-ok
3267 //fmt.Println("NextMethod: class:90 method:31")
3268 method := &txRollbackOk{}
3269 if err = method.read(r.r); err != nil {
3275 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
3279 switch mf.MethodId {
3281 case 10: // confirm select
3282 //fmt.Println("NextMethod: class:85 method:10")
3283 method := &confirmSelect{}
3284 if err = method.read(r.r); err != nil {
3289 case 11: // confirm select-ok
3290 //fmt.Println("NextMethod: class:85 method:11")
3291 method := &confirmSelectOk{}
3292 if err = method.read(r.r); err != nil {
3298 return nil, fmt.Errorf("Bad method frame, unknown method %d for class %d", mf.MethodId, mf.ClassId)
3302 return nil, fmt.Errorf("Bad method frame, unknown class %d", mf.ClassId)