Beispiel #1
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Message) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var ssz uint32
		ssz, bts, err = msgp.ReadArrayHeaderBytes(bts)
		if err != nil {
			return
		}
		if ssz != 4 {
			err = msgp.ArrayError{Wanted: 4, Got: ssz}
			return
		}
	}
	z.Tag, bts, err = msgp.ReadStringBytes(bts)
	if err != nil {
		return
	}
	z.Time, bts, err = msgp.ReadInt64Bytes(bts)
	if err != nil {
		return
	}
	z.Record, bts, err = msgp.ReadIntfBytes(bts)
	if err != nil {
		return
	}
	z.Option, bts, err = msgp.ReadIntfBytes(bts)
	if err != nil {
		return
	}
	o = bts
	return
}
Beispiel #2
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Forward) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var ssz uint32
		ssz, bts, err = msgp.ReadArrayHeaderBytes(bts)
		if err != nil {
			return
		}
		if ssz != 3 {
			err = msgp.ArrayError{Wanted: 3, Got: ssz}
			return
		}
	}
	z.Tag, bts, err = msgp.ReadStringBytes(bts)
	if err != nil {
		return
	}
	var xsz uint32
	xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
	if err != nil {
		return
	}
	if cap(z.Entries) >= int(xsz) {
		z.Entries = z.Entries[:xsz]
	} else {
		z.Entries = make([]Entry, xsz)
	}
	for xvk := range z.Entries {
		{
			var ssz uint32
			ssz, bts, err = msgp.ReadArrayHeaderBytes(bts)
			if err != nil {
				return
			}
			if ssz != 2 {
				err = msgp.ArrayError{Wanted: 2, Got: ssz}
				return
			}
		}
		z.Entries[xvk].Time, bts, err = msgp.ReadInt64Bytes(bts)
		if err != nil {
			return
		}
		z.Entries[xvk].Record, bts, err = msgp.ReadIntfBytes(bts)
		if err != nil {
			return
		}
	}
	z.Option, bts, err = msgp.ReadIntfBytes(bts)
	if err != nil {
		return
	}
	o = bts
	return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *CacheRegistry) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var bzg uint32
	bzg, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		return
	}
	for bzg > 0 {
		bzg--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "CacheKey":
			z.CacheKey, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				return
			}
		case "Payload":
			z.Payload, bts, err = msgp.ReadIntfBytes(bts)
			if err != nil {
				return
			}
		case "StoreTTL":
			z.StoreTTL, bts, err = msgp.ReadFloat64Bytes(bts)
			if err != nil {
				return
			}
		case "CacheTime":
			z.CacheTime, bts, err = msgp.ReadTimeBytes(bts)
			if err != nil {
				return
			}
		case "HasValue":
			z.HasValue, bts, err = msgp.ReadBoolBytes(bts)
			if err != nil {
				return
			}
		case "TypeName":
			z.TypeName, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				return
			}
		}
	}
	o = bts
	return
}
Beispiel #4
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Key) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var isz uint32
	isz, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		return
	}
	for isz > 0 {
		isz--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "u":
			{
				var tmp []byte
				tmp, bts, err = msgp.ReadBytesBytes(bts, []byte(z.UUID))
				z.UUID = ID(tmp)
			}
			if err != nil {
				return
			}
		case "v":
			z.Value, bts, err = msgp.ReadIntfBytes(bts)
			if err != nil {
				return
			}
		case "p":
			z.Payload, bts, err = msgp.ReadBytesBytes(bts, z.Payload)
			if err != nil {
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				return
			}
		}
	}
	o = bts
	return
}
Beispiel #5
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Entry) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var ssz uint32
		ssz, bts, err = msgp.ReadArrayHeaderBytes(bts)
		if err != nil {
			return
		}
		if ssz != 2 {
			err = msgp.ArrayError{Wanted: 2, Got: ssz}
			return
		}
	}
	z.Time, bts, err = msgp.ReadInt64Bytes(bts)
	if err != nil {
		return
	}
	z.Record, bts, err = msgp.ReadIntfBytes(bts)
	if err != nil {
		return
	}
	o = bts
	return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *ServerResponse) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var ssz uint32
		ssz, bts, err = msgp.ReadArrayHeaderBytes(bts)
		if err != nil {
			return
		}
		if ssz != 3 {
			err = msgp.ArrayError{Wanted: 3, Got: ssz}
			return
		}
	}
	if msgp.IsNil(bts) {
		bts, err = msgp.ReadNilBytes(bts)
		if err != nil {
			return
		}
		z.Header = nil
	} else {
		if z.Header == nil {
			z.Header = new(EventHeader)
		}
		var field []byte
		_ = field
		var isz uint32
		isz, bts, err = msgp.ReadMapHeaderBytes(bts)
		if err != nil {
			return
		}
		for isz > 0 {
			isz--
			field, bts, err = msgp.ReadMapKeyZC(bts)
			if err != nil {
				return
			}
			switch msgp.UnsafeString(field) {
			case "message_id":
				z.Header.Id, bts, err = msgp.ReadStringBytes(bts)
				if err != nil {
					return
				}
			case "v":
				z.Header.Version, bts, err = msgp.ReadIntBytes(bts)
				if err != nil {
					return
				}
			case "response_to":
				z.Header.ResponseTo, bts, err = msgp.ReadStringBytes(bts)
				if err != nil {
					return
				}
			default:
				bts, err = msgp.Skip(bts)
				if err != nil {
					return
				}
			}
		}
	}
	z.Name, bts, err = msgp.ReadStringBytes(bts)
	if err != nil {
		return
	}
	var xsz uint32
	xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
	if err != nil {
		return
	}
	if cap(z.Params) >= int(xsz) {
		z.Params = z.Params[:xsz]
	} else {
		z.Params = make([]interface{}, xsz)
	}
	for bzg := range z.Params {
		z.Params[bzg], bts, err = msgp.ReadIntfBytes(bts)
		if err != nil {
			return
		}
	}
	o = bts
	return
}
Beispiel #7
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Message) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var isz uint32
	isz, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		return
	}
	for isz > 0 {
		isz--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "body":
			z.Body, bts, err = msgp.ReadBytesBytes(bts, z.Body)
			if err != nil {
				return
			}
		case "meta":
			var msz uint32
			msz, bts, err = msgp.ReadMapHeaderBytes(bts)
			if err != nil {
				return
			}
			if z.Meta == nil && msz > 0 {
				z.Meta = make(map[string]interface{}, msz)
			} else if len(z.Meta) > 0 {
				for key, _ := range z.Meta {
					delete(z.Meta, key)
				}
			}
			for msz > 0 {
				var xvk string
				var bzg interface{}
				msz--
				xvk, bts, err = msgp.ReadStringBytes(bts)
				if err != nil {
					return
				}
				bzg, bts, err = msgp.ReadIntfBytes(bts)
				if err != nil {
					return
				}
				z.Meta[xvk] = bzg
			}
		case "ct":
			z.ContentType, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				return
			}
		}
	}
	o = bts
	return
}
Beispiel #8
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Node) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var isz uint32
	isz, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		return
	}
	for isz > 0 {
		isz--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "id":
			{
				var tmp []byte
				tmp, bts, err = msgp.ReadBytesBytes(bts, []byte(z.ID))
				z.ID = ID(tmp)
			}
			if err != nil {
				return
			}
		case "il":
			z.IsLeaf, bts, err = msgp.ReadBoolBytes(bts)
			if err != nil {
				return
			}
		case "cv":
			var xsz uint32
			xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
			if err != nil {
				return
			}
			if cap(z.ChildValues) >= int(xsz) {
				z.ChildValues = z.ChildValues[:xsz]
			} else {
				z.ChildValues = make([]interface{}, xsz)
			}
			for cmr := range z.ChildValues {
				z.ChildValues[cmr], bts, err = msgp.ReadIntfBytes(bts)
				if err != nil {
					return
				}
			}
		case "ck":
			var xsz uint32
			xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
			if err != nil {
				return
			}
			if cap(z.ChildKeys) >= int(xsz) {
				z.ChildKeys = z.ChildKeys[:xsz]
			} else {
				z.ChildKeys = make(Keys, xsz)
			}
			for ajw := range z.ChildKeys {
				if msgp.IsNil(bts) {
					bts, err = msgp.ReadNilBytes(bts)
					if err != nil {
						return
					}
					z.ChildKeys[ajw] = nil
				} else {
					if z.ChildKeys[ajw] == nil {
						z.ChildKeys[ajw] = new(Key)
					}
					bts, err = z.ChildKeys[ajw].UnmarshalMsg(bts)
					if err != nil {
						return
					}
				}
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				return
			}
		}
	}
	o = bts
	return
}