// 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
}
Esempio n. 2
0
// EncodeMsg implements msgp.Encodable
func (z contype) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteUint8(uint8(z))
	if err != nil {
		return
	}
	return
}
Esempio n. 3
0
// EncodeMsg implements msgp.Encodable
func (z Ztype) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteInt32(int32(z))
	if err != nil {
		return
	}
	return
}
// EncodeMsg implements msgp.Encodable
func (z DocumentID) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteUint(uint(z))
	if err != nil {
		return
	}
	return
}
Esempio n. 5
0
// EncodeMsg implements msgp.Encodable
func (z Binary) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteBytes([]byte(z))
	if err != nil {
		return
	}
	return
}
Esempio n. 6
0
// EncodeMsg implements msgp.Encodable
func (z *KV) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(2)
	if err != nil {
		return
	}
	for xvk := range z {
		err = en.WriteBytes([]byte(z[xvk]))
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 7
0
// EncodeMsg implements msgp.Encodable
func (z uint32Slice) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		return
	}
	for zzpf := range z {
		err = en.WriteUint32(z[zzpf])
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 8
0
// EncodeMsg implements msgp.Encodable
func (z StructInstance) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 1
	// write "StructId"
	err = en.Append(0x81, 0xa8, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.StructId)
	if err != nil {
		return
	}
	return
}
Esempio n. 9
0
// EncodeMsg implements msgp.Encodable
func (z Error) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 1
	// write "msg"
	err = en.Append(0x81, 0xa3, 0x6d, 0x73, 0x67)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Msg)
	if err != nil {
		return
	}
	return
}
// EncodeMsg implements msgp.Encodable
func (z DocumentList) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		return
	}
	for bai := range z {
		err = en.WriteUint(uint(z[bai]))
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 11
0
// EncodeMsg implements msgp.Encodable
func (z Ks) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		return
	}
	for cxo := range z {
		err = en.WriteBytes([]byte(z[cxo]))
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 12
0
// EncodeMsg implements msgp.Encodable
func (z MetricDataArray) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		return
	}
	for cmr := range z {
		if z[cmr] == nil {
			err = en.WriteNil()
			if err != nil {
				return
			}
		} else {
			err = z[cmr].EncodeMsg(en)
			if err != nil {
				return
			}
		}
	}
	return
}
Esempio n. 13
0
// EncodeMsg implements msgp.Encodable
func (z *Message) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(4)
	if err != nil {
		return
	}
	err = en.WriteString(z.Tag)
	if err != nil {
		return
	}
	err = en.WriteInt64(z.Time)
	if err != nil {
		return
	}
	err = en.WriteIntf(z.Record)
	if err != nil {
		return
	}
	err = en.WriteIntf(z.Option)
	if err != nil {
		return
	}
	return
}
Esempio n. 14
0
// EncodeMsg encodes the notification to writer. The body is expected to
// be an encodable type.
func (n *Notification) EncodeMsg(w *msgp.Writer) error {
	var bm msgp.Encodable

	if n.Body != nil {
		var ok bool
		bm, ok = n.Body.(msgp.Encodable)
		if !ok {
			return ErrNotEncodable
		}
	}

	var err error

	if err = w.WriteArrayHeader(NotificationPackSize); err != nil {
		return err
	}

	if err = w.WriteInt(NotificationType); err != nil {
		return err
	}

	if err = w.WriteString(n.Method); err != nil {
		return err
	}

	// No body to encode. Write a zero-length params array.
	if bm == nil {
		return w.WriteArrayHeader(0)
	}

	// 1-item array containing the body.
	if err = w.WriteArrayHeader(1); err != nil {
		return err
	}

	return msgp.Encode(w, bm)
}
Esempio n. 15
0
// EncodeMsg implements msgp.Encodable
func (z Incoming) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "from"
	err = en.Append(0x82, 0xa4, 0x66, 0x72, 0x6f, 0x6d)
	if err != nil {
		return err
	}
	err = en.WriteString(z.From)
	if err != nil {
		return
	}
	// write "message"
	err = en.Append(0xa7, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Message)
	if err != nil {
		return
	}
	return
}
Esempio n. 16
0
// EncodeMsg implements msgp.Encodable
func (z Foo) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "bar"
	err = en.Append(0x82, 0xa3, 0x62, 0x61, 0x72)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Bar)
	if err != nil {
		return
	}
	// write "baz"
	err = en.Append(0xa3, 0x62, 0x61, 0x7a)
	if err != nil {
		return err
	}
	err = en.WriteFloat64(z.Baz)
	if err != nil {
		return
	}
	return
}
Esempio n. 17
0
// EncodeMsg implements msgp.Encodable
func (z interval32) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "start"
	err = en.Append(0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteUint32(z.start)
	if err != nil {
		return
	}
	// write "last"
	err = en.Append(0xa4, 0x6c, 0x61, 0x73, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteUint32(z.last)
	if err != nil {
		return
	}
	return
}
Esempio n. 18
0
// EncodeMsg implements msgp.Encodable
func (z Person) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "first"
	err = en.Append(0x82, 0xa5, 0x66, 0x69, 0x72, 0x73, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteString(z.First)
	if err != nil {
		return
	}
	// write "last"
	err = en.Append(0xa4, 0x6c, 0x61, 0x73, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Last)
	if err != nil {
		return
	}
	return
}
Esempio n. 19
0
// EncodeMsg implements msgp.Encodable
func (z Entry) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(2)
	if err != nil {
		return
	}
	err = en.WriteInt64(z.Time)
	if err != nil {
		return
	}
	err = en.WriteIntf(z.Record)
	if err != nil {
		return
	}
	return
}
Esempio n. 20
0
// EncodeMsg implements msgp.Encodable
func (z *arrayContainer) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 1
	// write "content"
	err = en.Append(0x81, 0xa7, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.content)))
	if err != nil {
		return
	}
	for zxvk := range z.content {
		err = en.WriteUint16(z.content[zxvk])
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 21
0
// EncodeMsg implements msgp.Encodable
func (z KVs) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		return
	}
	for wht := range z {
		err = en.WriteArrayHeader(2)
		if err != nil {
			return
		}
		for hct := range z[wht] {
			err = en.WriteBytes([]byte(z[wht][hct]))
			if err != nil {
				return
			}
		}
	}
	return
}
Esempio n. 22
0
// EncodeMsg implements msgp.Encodable
func (z *containerSerz) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "t"
	err = en.Append(0x82, 0xa1, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteUint8(uint8(z.t))
	if err != nil {
		return
	}
	// write "r"
	err = en.Append(0xa1, 0x72)
	if err != nil {
		return err
	}
	err = z.r.EncodeMsg(en)
	if err != nil {
		return
	}
	return
}
Esempio n. 23
0
// EncodeMsg implements msgp.Encodable
func (z *ProbeEvent) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 8
	// write "Id"
	err = en.Append(0x88, 0xa2, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Id)
	if err != nil {
		return
	}
	// write "EventType"
	err = en.Append(0xa9, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.EventType)
	if err != nil {
		return
	}
	// write "OrgId"
	err = en.Append(0xa5, 0x4f, 0x72, 0x67, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.OrgId)
	if err != nil {
		return
	}
	// write "Severity"
	err = en.Append(0xa8, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Severity)
	if err != nil {
		return
	}
	// write "Source"
	err = en.Append(0xa6, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Source)
	if err != nil {
		return
	}
	// write "Timestamp"
	err = en.Append(0xa9, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.Timestamp)
	if err != nil {
		return
	}
	// write "Message"
	err = en.Append(0xa7, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Message)
	if err != nil {
		return
	}
	// write "Tags"
	err = en.Append(0xa4, 0x54, 0x61, 0x67, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteMapHeader(uint32(len(z.Tags)))
	if err != nil {
		return
	}
	for xvk, bzg := range z.Tags {
		err = en.WriteString(xvk)
		if err != nil {
			return
		}
		err = en.WriteString(bzg)
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 24
0
// EncodeMsg implements msgp.Encodable
func (z *A) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 6
	// write "Name"
	err = en.Append(0x86, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Name)
	if err != nil {
		return
	}
	// write "BirthDay"
	err = en.Append(0xa8, 0x42, 0x69, 0x72, 0x74, 0x68, 0x44, 0x61, 0x79)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.BirthDay)
	if err != nil {
		return
	}
	// write "Phone"
	err = en.Append(0xa5, 0x50, 0x68, 0x6f, 0x6e, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Phone)
	if err != nil {
		return
	}
	// write "Siblings"
	err = en.Append(0xa8, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.Siblings)
	if err != nil {
		return
	}
	// write "Spouse"
	err = en.Append(0xa6, 0x53, 0x70, 0x6f, 0x75, 0x73, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteUint8(z.Spouse)
	if err != nil {
		return
	}
	// write "Money"
	err = en.Append(0xa5, 0x4d, 0x6f, 0x6e, 0x65, 0x79)
	if err != nil {
		return err
	}
	err = en.WriteFloat64(z.Money)
	if err != nil {
		return
	}
	return
}
Esempio n. 25
0
// EncodeMsg implements msgp.Encodable
func (z Person) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 3
	// write "Name"
	err = en.Append(0x83, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Name)
	if err != nil {
		return
	}
	// write "Age"
	err = en.Append(0xa3, 0x41, 0x67, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteUint8(z.Age)
	if err != nil {
		return
	}
	// write "Height"
	err = en.Append(0xa6, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteFloat64(z.Height)
	if err != nil {
		return
	}
	return
}
Esempio n. 26
0
// EncodeMsg implements msgp.Encodable
func (z *Group) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "Name"
	err = en.Append(0x82, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Name)
	if err != nil {
		return
	}
	// write "Members"
	err = en.Append(0xa7, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.Members)))
	if err != nil {
		return
	}
	for xvk := range z.Members {
		// map header, size 3
		// write "Name"
		err = en.Append(0x83, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
		if err != nil {
			return err
		}
		err = en.WriteString(z.Members[xvk].Name)
		if err != nil {
			return
		}
		// write "Age"
		err = en.Append(0xa3, 0x41, 0x67, 0x65)
		if err != nil {
			return err
		}
		err = en.WriteUint8(z.Members[xvk].Age)
		if err != nil {
			return
		}
		// write "Height"
		err = en.Append(0xa6, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74)
		if err != nil {
			return err
		}
		err = en.WriteFloat64(z.Members[xvk].Height)
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 27
0
// EncodeMsg implements msgp.Encodable
func (z *MetricData) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 9
	// write "OrgId"
	err = en.Append(0x89, 0xa5, 0x4f, 0x72, 0x67, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.OrgId)
	if err != nil {
		return
	}
	// write "Name"
	err = en.Append(0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Name)
	if err != nil {
		return
	}
	// write "Metric"
	err = en.Append(0xa6, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Metric)
	if err != nil {
		return
	}
	// write "Interval"
	err = en.Append(0xa8, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.Interval)
	if err != nil {
		return
	}
	// write "Value"
	err = en.Append(0xa5, 0x56, 0x61, 0x6c, 0x75, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteFloat64(z.Value)
	if err != nil {
		return
	}
	// write "Unit"
	err = en.Append(0xa4, 0x55, 0x6e, 0x69, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Unit)
	if err != nil {
		return
	}
	// write "Time"
	err = en.Append(0xa4, 0x54, 0x69, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.Time)
	if err != nil {
		return
	}
	// write "TargetType"
	err = en.Append(0xaa, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.TargetType)
	if err != nil {
		return
	}
	// write "Tags"
	err = en.Append(0xa4, 0x54, 0x61, 0x67, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.Tags)))
	if err != nil {
		return
	}
	for xvk := range z.Tags {
		err = en.WriteString(z.Tags[xvk])
		if err != nil {
			return
		}
	}
	return
}
Esempio n. 28
0
// EncodeMsg implements msgp.Encodable
func (z *MetricDefinition) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 11
	// write "Id"
	err = en.Append(0x8b, 0xa2, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Id)
	if err != nil {
		return
	}
	// write "OrgId"
	err = en.Append(0xa5, 0x4f, 0x72, 0x67, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.OrgId)
	if err != nil {
		return
	}
	// write "Name"
	err = en.Append(0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Name)
	if err != nil {
		return
	}
	// write "Metric"
	err = en.Append(0xa6, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Metric)
	if err != nil {
		return
	}
	// write "Interval"
	err = en.Append(0xa8, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.Interval)
	if err != nil {
		return
	}
	// write "Unit"
	err = en.Append(0xa4, 0x55, 0x6e, 0x69, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Unit)
	if err != nil {
		return
	}
	// write "TargetType"
	err = en.Append(0xaa, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.TargetType)
	if err != nil {
		return
	}
	// write "Tags"
	err = en.Append(0xa4, 0x54, 0x61, 0x67, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.Tags)))
	if err != nil {
		return
	}
	for hct := range z.Tags {
		err = en.WriteString(z.Tags[hct])
		if err != nil {
			return
		}
	}
	// write "LastUpdate"
	err = en.Append(0xaa, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.LastUpdate)
	if err != nil {
		return
	}
	// write "Nodes"
	err = en.Append(0xa5, 0x4e, 0x6f, 0x64, 0x65, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteMapHeader(uint32(len(z.Nodes)))
	if err != nil {
		return
	}
	for cua, xhx := range z.Nodes {
		err = en.WriteString(cua)
		if err != nil {
			return
		}
		err = en.WriteString(xhx)
		if err != nil {
			return
		}
	}
	// write "NodeCount"
	err = en.Append(0xa9, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.NodeCount)
	if err != nil {
		return
	}
	return
}
Esempio n. 29
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
}
Esempio n. 30
0
// EncodeMsg implements msgp.Encodable
func (z *Packet) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 4
	// write "type"
	err = en.Append(0x84, 0xa4, 0x74, 0x79, 0x70, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteByte(z.pType)
	if err != nil {
		return
	}
	// write "id"
	err = en.Append(0xa2, 0x69, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteInt(z.id)
	if err != nil {
		return
	}
	// write "event"
	err = en.Append(0xa5, 0x65, 0x76, 0x65, 0x6e, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteString(z.eventName)
	if err != nil {
		return
	}
	// write "payload"
	err = en.Append(0xa7, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteBytes(z.payload)
	if err != nil {
		return
	}
	return
}