package proto // Code generated by github.com/tinylib/msgp DO NOT EDIT. import ( "github.com/tinylib/msgp/msgp" ) // DecodeMsg implements msgp.Decodable func (z *RequestError) DecodeMsg(dc *msgp.Reader) (err error) { var field []byte _ = field var zb0001 uint32 zb0001, err = dc.ReadMapHeader() if err != nil { err = msgp.WrapError(err) return } for zb0001 > 0 { zb0001-- field, err = dc.ReadMapKeyPtr() if err != nil { err = msgp.WrapError(err) return } switch msgp.UnsafeString(field) { case "msg": z.Message, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "Message") return } case "error_code": z.ErrorCode, err = dc.ReadInt() if err != nil { err = msgp.WrapError(err, "ErrorCode") return } default: err = dc.Skip() if err != nil { err = msgp.WrapError(err) return } } } return } // EncodeMsg implements msgp.Encodable func (z RequestError) EncodeMsg(en *msgp.Writer) (err error) { // map header, size 2 // write "msg" err = en.Append(0x82, 0xa3, 0x6d, 0x73, 0x67) if err != nil { return } err = en.WriteString(z.Message) if err != nil { err = msgp.WrapError(err, "Message") return } // write "error_code" err = en.Append(0xaa, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65) if err != nil { return } err = en.WriteInt(z.ErrorCode) if err != nil { err = msgp.WrapError(err, "ErrorCode") return } return } // MarshalMsg implements msgp.Marshaler func (z RequestError) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) // map header, size 2 // string "msg" o = append(o, 0x82, 0xa3, 0x6d, 0x73, 0x67) o = msgp.AppendString(o, z.Message) // string "error_code" o = append(o, 0xaa, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65) o = msgp.AppendInt(o, z.ErrorCode) return } // UnmarshalMsg implements msgp.Unmarshaler func (z *RequestError) UnmarshalMsg(bts []byte) (o []byte, err error) { var field []byte _ = field var zb0001 uint32 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err) return } for zb0001 > 0 { zb0001-- field, bts, err = msgp.ReadMapKeyZC(bts) if err != nil { err = msgp.WrapError(err) return } switch msgp.UnsafeString(field) { case "msg": z.Message, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "Message") return } case "error_code": z.ErrorCode, bts, err = msgp.ReadIntBytes(bts) if err != nil { err = msgp.WrapError(err, "ErrorCode") return } default: bts, err = msgp.Skip(bts) if err != nil { err = msgp.WrapError(err) return } } } o = bts return } // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message func (z RequestError) Msgsize() (s int) { s = 1 + 4 + msgp.StringPrefixSize + len(z.Message) + 11 + msgp.IntSize return } // DecodeMsg implements msgp.Decodable func (z *Response) DecodeMsg(dc *msgp.Reader) (err error) { var field []byte _ = field var zb0001 uint32 zb0001, err = dc.ReadMapHeader() if err != nil { err = msgp.WrapError(err) return } for zb0001 > 0 { zb0001-- field, err = dc.ReadMapKeyPtr() if err != nil { err = msgp.WrapError(err) return } switch msgp.UnsafeString(field) { case "id": z.Id, err = dc.ReadUint32() if err != nil { err = msgp.WrapError(err, "Id") return } case "result": var zb0002 uint32 zb0002, err = dc.ReadArrayHeader() if err != nil { err = msgp.WrapError(err, "Result") return } if cap(z.Result) >= int(zb0002) { z.Result = (z.Result)[:zb0002] } else { z.Result = make([]interface{}, zb0002) } for za0001 := range z.Result { z.Result[za0001], err = dc.ReadIntf() if err != nil { err = msgp.WrapError(err, "Result", za0001) return } } case "error": var zb0003 uint32 zb0003, err = dc.ReadMapHeader() if err != nil { err = msgp.WrapError(err, "Error") return } for zb0003 > 0 { zb0003-- field, err = dc.ReadMapKeyPtr() if err != nil { err = msgp.WrapError(err, "Error") return } switch msgp.UnsafeString(field) { case "msg": z.Error.Message, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "Error", "Message") return } case "error_code": z.Error.ErrorCode, err = dc.ReadInt() if err != nil { err = msgp.WrapError(err, "Error", "ErrorCode") return } default: err = dc.Skip() if err != nil { err = msgp.WrapError(err, "Error") return } } } default: err = dc.Skip() if err != nil { err = msgp.WrapError(err) return } } } return } // EncodeMsg implements msgp.Encodable func (z *Response) EncodeMsg(en *msgp.Writer) (err error) { // map header, size 3 // write "id" err = en.Append(0x83, 0xa2, 0x69, 0x64) if err != nil { return } err = en.WriteUint32(z.Id) if err != nil { err = msgp.WrapError(err, "Id") return } // write "result" err = en.Append(0xa6, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74) if err != nil { return } err = en.WriteArrayHeader(uint32(len(z.Result))) if err != nil { err = msgp.WrapError(err, "Result") return } for za0001 := range z.Result { err = en.WriteIntf(z.Result[za0001]) if err != nil { err = msgp.WrapError(err, "Result", za0001) return } } // write "error" err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) if err != nil { return } // map header, size 2 // write "msg" err = en.Append(0x82, 0xa3, 0x6d, 0x73, 0x67) if err != nil { return } err = en.WriteString(z.Error.Message) if err != nil { err = msgp.WrapError(err, "Error", "Message") return } // write "error_code" err = en.Append(0xaa, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65) if err != nil { return } err = en.WriteInt(z.Error.ErrorCode) if err != nil { err = msgp.WrapError(err, "Error", "ErrorCode") return } return } // MarshalMsg implements msgp.Marshaler func (z *Response) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) // map header, size 3 // string "id" o = append(o, 0x83, 0xa2, 0x69, 0x64) o = msgp.AppendUint32(o, z.Id) // string "result" o = append(o, 0xa6, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74) o = msgp.AppendArrayHeader(o, uint32(len(z.Result))) for za0001 := range z.Result { o, err = msgp.AppendIntf(o, z.Result[za0001]) if err != nil { err = msgp.WrapError(err, "Result", za0001) return } } // string "error" o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) // map header, size 2 // string "msg" o = append(o, 0x82, 0xa3, 0x6d, 0x73, 0x67) o = msgp.AppendString(o, z.Error.Message) // string "error_code" o = append(o, 0xaa, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65) o = msgp.AppendInt(o, z.Error.ErrorCode) return } // UnmarshalMsg implements msgp.Unmarshaler func (z *Response) UnmarshalMsg(bts []byte) (o []byte, err error) { var field []byte _ = field var zb0001 uint32 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err) return } for zb0001 > 0 { zb0001-- field, bts, err = msgp.ReadMapKeyZC(bts) if err != nil { err = msgp.WrapError(err) return } switch msgp.UnsafeString(field) { case "id": z.Id, bts, err = msgp.ReadUint32Bytes(bts) if err != nil { err = msgp.WrapError(err, "Id") return } case "result": var zb0002 uint32 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) if err != nil { err = msgp.WrapError(err, "Result") return } if cap(z.Result) >= int(zb0002) { z.Result = (z.Result)[:zb0002] } else { z.Result = make([]interface{}, zb0002) } for za0001 := range z.Result { z.Result[za0001], bts, err = msgp.ReadIntfBytes(bts) if err != nil { err = msgp.WrapError(err, "Result", za0001) return } } case "error": var zb0003 uint32 zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err, "Error") return } for zb0003 > 0 { zb0003-- field, bts, err = msgp.ReadMapKeyZC(bts) if err != nil { err = msgp.WrapError(err, "Error") return } switch msgp.UnsafeString(field) { case "msg": z.Error.Message, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "Error", "Message") return } case "error_code": z.Error.ErrorCode, bts, err = msgp.ReadIntBytes(bts) if err != nil { err = msgp.WrapError(err, "Error", "ErrorCode") return } default: bts, err = msgp.Skip(bts) if err != nil { err = msgp.WrapError(err, "Error") return } } } default: bts, err = msgp.Skip(bts) if err != nil { err = msgp.WrapError(err) return } } } o = bts return } // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message func (z *Response) Msgsize() (s int) { s = 1 + 3 + msgp.Uint32Size + 7 + msgp.ArrayHeaderSize for za0001 := range z.Result { s += msgp.GuessSize(z.Result[za0001]) } s += 6 + 1 + 4 + msgp.StringPrefixSize + len(z.Error.Message) + 11 + msgp.IntSize return }