// EncodeMsg implements msgp.Encodable
func (z *bitmapContainer) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "cardinality"
	err = en.Append(0x82, 0xab, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.cardinality)
	if err != nil {
		return
	}
	// write "bitmap"
	err = en.Append(0xa6, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.bitmap)))
	if err != nil {
		return
	}
	for zxvk := range z.bitmap {
		err = en.WriteUint64(z.bitmap[zxvk])
		if err != nil {
			return
		}
	}
	return
}
// EncodeMsg implements msgp.Encodable
func (z *bitmapContainerShortIterator) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "ptr"
	err = en.Append(0x82, 0xa3, 0x70, 0x74, 0x72)
	if err != nil {
		return err
	}
	if z.ptr == nil {
		err = en.WriteNil()
		if err != nil {
			return
		}
	} else {
		// map header, size 2
		// write "cardinality"
		err = en.Append(0x82, 0xab, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79)
		if err != nil {
			return err
		}
		err = en.WriteInt(z.ptr.cardinality)
		if err != nil {
			return
		}
		// write "bitmap"
		err = en.Append(0xa6, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70)
		if err != nil {
			return err
		}
		err = en.WriteArrayHeader(uint32(len(z.ptr.bitmap)))
		if err != nil {
			return
		}
		for zwht := range z.ptr.bitmap {
			err = en.WriteUint64(z.ptr.bitmap[zwht])
			if err != nil {
				return
			}
		}
	}
	// write "i"
	err = en.Append(0xa1, 0x69)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.i)
	if err != nil {
		return
	}
	return
}
Beispiel #3
0
// EncodeMsg implements msgp.Encodable
func (z *Message) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 5
	// write "id"
	err = en.Append(0x85, 0xa2, 0x69, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteUint64(z.ID)
	if err != nil {
		return
	}
	// write "fn"
	err = en.Append(0xa2, 0x66, 0x6e)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Func)
	if err != nil {
		return
	}
	// write "args"
	err = en.Append(0xa4, 0x61, 0x72, 0x67, 0x73)
	if err != nil {
		return err
	}
	err = z.Args.EncodeMsg(en)
	if err != nil {
		return
	}
	// write "result"
	err = en.Append(0xa6, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74)
	if err != nil {
		return err
	}
	err = z.Result.EncodeMsg(en)
	if err != nil {
		return
	}
	// write "error"
	err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72)
	if err != nil {
		return err
	}
	if z.Error == nil {
		err = en.WriteNil()
		if err != nil {
			return
		}
	} else {
		// map header, size 1
		// write "msg"
		err = en.Append(0x81, 0xa3, 0x6d, 0x73, 0x67)
		if err != nil {
			return err
		}
		err = en.WriteString(z.Error.Msg)
		if err != nil {
			return
		}
	}
	return
}