Esempio n. 1
0
func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	yym8 := z.DecBinary()
	_ = yym8
	if false {
	} else if z.HasExtensions() && z.DecExt(x) {
	} else {
		if r.IsContainerType(codecSelferValueTypeMap1819) {
			yyl9 := r.ReadMapStart()
			if yyl9 == 0 {
				r.ReadEnd()
			} else {
				x.codecDecodeSelfFromMap(yyl9, d)
			}
		} else if r.IsContainerType(codecSelferValueTypeArray1819) {
			yyl9 := r.ReadArrayStart()
			if yyl9 == 0 {
				r.ReadEnd()
			} else {
				x.codecDecodeSelfFromArray(yyl9, d)
			}
		} else {
			panic(codecSelferOnlyMapOrArrayEncodeToStructErr1819)
		}
	}
}
Esempio n. 2
0
func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	yym44 := z.DecBinary()
	_ = yym44
	if false {
	} else if z.HasExtensions() && z.DecExt(x) {
	} else {
		yyct45 := r.ContainerType()
		if yyct45 == codecSelferValueTypeMap1819 {
			yyl45 := r.ReadMapStart()
			if yyl45 == 0 {
				z.DecSendContainerState(codecSelfer_containerMapEnd1819)
			} else {
				x.codecDecodeSelfFromMap(yyl45, d)
			}
		} else if yyct45 == codecSelferValueTypeArray1819 {
			yyl45 := r.ReadArrayStart()
			if yyl45 == 0 {
				z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
			} else {
				x.codecDecodeSelfFromArray(yyl45, d)
			}
		} else {
			panic(codecSelferOnlyMapOrArrayEncodeToStructErr1819)
		}
	}
}
Esempio n. 3
0
func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys10Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys10Slc
	var yyhl10 bool = l >= 0
	for yyj10 := 0; ; yyj10++ {
		if yyhl10 {
			if yyj10 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
		}
		z.DecSendContainerState(codecSelfer_containerMapKey1819)
		yys10Slc = r.DecodeBytes(yys10Slc, true, true)
		yys10 := string(yys10Slc)
		z.DecSendContainerState(codecSelfer_containerMapValue1819)
		switch yys10 {
		case "action":
			if r.TryDecodeAsNil() {
				x.Action = ""
			} else {
				x.Action = string(r.DecodeString())
			}
		case "node":
			if r.TryDecodeAsNil() {
				if x.Node != nil {
					x.Node = nil
				}
			} else {
				if x.Node == nil {
					x.Node = new(Node)
				}
				x.Node.CodecDecodeSelf(d)
			}
		case "prevNode":
			if r.TryDecodeAsNil() {
				if x.PrevNode != nil {
					x.PrevNode = nil
				}
			} else {
				if x.PrevNode == nil {
					x.PrevNode = new(Node)
				}
				x.PrevNode.CodecDecodeSelf(d)
			}
		default:
			z.DecStructFieldNotFound(-1, yys10)
		} // end switch yys10
	} // end for yyj10
	z.DecSendContainerState(codecSelfer_containerMapEnd1819)
}
Esempio n. 4
0
func (x *RawResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys6Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys6Slc
	var yyhl6 bool = l >= 0
	for yyj6 := 0; ; yyj6++ {
		if yyhl6 {
			if yyj6 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
			if yyj6 > 0 {
				r.ReadMapEntrySeparator()
			}
		}
		yys6Slc = r.DecodeBytes(yys6Slc, true, true)
		yys6 := string(yys6Slc)
		if !yyhl6 {
			r.ReadMapKVSeparator()
		}
		switch yys6 {
		case "StatusCode":
			if r.TryDecodeAsNil() {
				x.StatusCode = 0
			} else {
				x.StatusCode = int(r.DecodeInt(codecSelferBitsize4402))
			}
		case "Body":
			if r.TryDecodeAsNil() {
				x.Body = nil
			} else {
				yyv8 := &x.Body
				*yyv8 = r.DecodeBytes(*(*[]byte)(yyv8), false, false)
			}
		case "Header":
			if r.TryDecodeAsNil() {
				x.Header = nil
			} else {
				yyv9 := &x.Header
				h.dechttp_Header((*http.Header)(yyv9), d)
			}
		default:
			z.DecStructFieldNotFound(-1, yys6)
		} // end switch yys6
	} // end for yyj6
	if !yyhl6 {
		r.ReadMapEnd()
	}
}
Esempio n. 5
0
func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	yym69 := z.DecBinary()
	_ = yym69
	if false {
	} else if z.HasExtensions() && z.DecExt(x) {
	} else {
		h.decNodes((*Nodes)(x), d)
	}
}
Esempio n. 6
0
func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	if r.IsContainerType(codecSelverValueTypeMap4402) {
		yyl45 := r.ReadMapStart()
		if yyl45 == 0 {
			r.ReadMapEnd()
		} else {
			x.codecDecodeSelfFromMap(yyl45, d)
		}
	} else if r.IsContainerType(codecSelverValueTypeArray4402) {
		yyl45 := r.ReadArrayStart()
		if yyl45 == 0 {
			r.ReadArrayEnd()
		} else {
			x.codecDecodeSelfFromArray(yyl45, d)
		}
	} else {
		panic(codecSelferOnlyMapOrArrayEncodeToStructErr4402)
	}
}
Esempio n. 7
0
func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys46Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys46Slc
	var yyhl46 bool = l >= 0
	for yyj46 := 0; ; yyj46++ {
		if yyhl46 {
			if yyj46 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
		}
		z.DecSendContainerState(codecSelfer_containerMapKey1819)
		yys46Slc = r.DecodeBytes(yys46Slc, true, true)
		yys46 := string(yys46Slc)
		z.DecSendContainerState(codecSelfer_containerMapValue1819)
		switch yys46 {
		case "key":
			if r.TryDecodeAsNil() {
				x.Key = ""
			} else {
				x.Key = string(r.DecodeString())
			}
		case "dir":
			if r.TryDecodeAsNil() {
				x.Dir = false
			} else {
				x.Dir = bool(r.DecodeBool())
			}
		case "value":
			if r.TryDecodeAsNil() {
				x.Value = ""
			} else {
				x.Value = string(r.DecodeString())
			}
		case "nodes":
			if r.TryDecodeAsNil() {
				x.Nodes = nil
			} else {
				yyv50 := &x.Nodes
				yyv50.CodecDecodeSelf(d)
			}
		case "createdIndex":
			if r.TryDecodeAsNil() {
				x.CreatedIndex = 0
			} else {
				x.CreatedIndex = uint64(r.DecodeUint(64))
			}
		case "modifiedIndex":
			if r.TryDecodeAsNil() {
				x.ModifiedIndex = 0
			} else {
				x.ModifiedIndex = uint64(r.DecodeUint(64))
			}
		case "expiration":
			if r.TryDecodeAsNil() {
				if x.Expiration != nil {
					x.Expiration = nil
				}
			} else {
				if x.Expiration == nil {
					x.Expiration = new(time.Time)
				}
				yym54 := z.DecBinary()
				_ = yym54
				if false {
				} else if yym55 := z.TimeRtidIfBinc(); yym55 != 0 {
					r.DecodeBuiltin(yym55, x.Expiration)
				} else if z.HasExtensions() && z.DecExt(x.Expiration) {
				} else if yym54 {
					z.DecBinaryUnmarshal(x.Expiration)
				} else if !yym54 && z.IsJSONHandle() {
					z.DecJSONUnmarshal(x.Expiration)
				} else {
					z.DecFallback(x.Expiration, false)
				}
			}
		case "ttl":
			if r.TryDecodeAsNil() {
				x.TTL = 0
			} else {
				x.TTL = int64(r.DecodeInt(64))
			}
		default:
			z.DecStructFieldNotFound(-1, yys46)
		} // end switch yys46
	} // end for yyj46
	z.DecSendContainerState(codecSelfer_containerMapEnd1819)
}
Esempio n. 8
0
func (x codecSelfer4402) decNodes(v *Nodes, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r

	yyv71 := *v
	yyh71, yyl71 := z.DecSliceHelperStart()

	var yyc71 bool
	if yyv71 == nil {
		if yyl71 <= 0 {
			yyv71 = make(Nodes, 0)
		} else {
			yyv71 = make(Nodes, yyl71)
		}
		yyc71 = true
	}

	if yyl71 == 0 {
		if len(yyv71) != 0 {
			yyv71 = yyv71[:0]
			yyc71 = true
		}
	} else if yyl71 > 0 {

		yyn71 := yyl71
		if yyl71 > cap(yyv71) {
			yyv71 = make([]*Node, yyl71, yyl71)
			yyc71 = true

		} else if yyl71 != len(yyv71) {
			yyv71 = yyv71[:yyl71]
			yyc71 = true
		}
		yyj71 := 0
		for ; yyj71 < yyn71; yyj71++ {
			if r.TryDecodeAsNil() {
				if yyv71[yyj71] != nil {
					*yyv71[yyj71] = Node{}
				}
			} else {
				if yyv71[yyj71] == nil {
					yyv71[yyj71] = new(Node)
				}
				yyw72 := yyv71[yyj71]
				yyw72.CodecDecodeSelf(d)
			}

		}

	} else {
		for yyj71 := 0; !r.CheckBreak(); yyj71++ {
			if yyj71 >= len(yyv71) {
				yyv71 = append(yyv71, nil) // var yyz71 *Node
				yyc71 = true
			}
			if yyj71 > 0 {
				yyh71.Sep(yyj71)
			}

			if yyj71 < len(yyv71) {
				if r.TryDecodeAsNil() {
					if yyv71[yyj71] != nil {
						*yyv71[yyj71] = Node{}
					}
				} else {
					if yyv71[yyj71] == nil {
						yyv71[yyj71] = new(Node)
					}
					yyw73 := yyv71[yyj71]
					yyw73.CodecDecodeSelf(d)
				}

			} else {
				z.DecSwallow()
			}

		}
		yyh71.End()
	}
	if yyc71 {
		*v = yyv71
	}
}
Esempio n. 9
0
func (x codecSelfer4402) dechttp_Header(v *http.Header, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r

	yyv65 := *v
	yyl65 := r.ReadMapStart()
	if yyv65 == nil {
		if yyl65 > 0 {
			yyv65 = make(map[string][]string, yyl65)
		} else {
			yyv65 = make(map[string][]string) // supports indefinite-length, etc
		}
		*v = yyv65
	}
	if yyl65 > 0 {
		for yyj65 := 0; yyj65 < yyl65; yyj65++ {
			var yymk65 string
			if r.TryDecodeAsNil() {
				yymk65 = ""
			} else {
				yymk65 = string(r.DecodeString())
			}

			yymv65 := yyv65[yymk65]
			if r.TryDecodeAsNil() {
				yymv65 = nil
			} else {
				yyv67 := &yymv65
				z.F.DecSliceStringX(yyv67, false, d)
			}

			if yyv65 != nil {
				yyv65[yymk65] = yymv65
			}
		}
	} else if yyl65 < 0 {
		for yyj65 := 0; !r.CheckBreak(); yyj65++ {
			if yyj65 > 0 {
				r.ReadMapEntrySeparator()
			}
			var yymk65 string
			if r.TryDecodeAsNil() {
				yymk65 = ""
			} else {
				yymk65 = string(r.DecodeString())
			}

			r.ReadMapKVSeparator()
			yymv65 := yyv65[yymk65]
			if r.TryDecodeAsNil() {
				yymv65 = nil
			} else {
				yyv69 := &yymv65
				z.F.DecSliceStringX(yyv69, false, d)
			}

			if yyv65 != nil {
				yyv65[yymk65] = yymv65
			}
		}
		r.ReadMapEnd()
	} // else len==0: TODO: Should we clear map entries?
}
Esempio n. 10
0
func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	h.decNodes((*Nodes)(x), d)
}
Esempio n. 11
0
func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj55 int
	var yyb55 bool
	var yyhl55 bool = l >= 0
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	if r.TryDecodeAsNil() {
		x.Key = ""
	} else {
		x.Key = string(r.DecodeString())
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Value = ""
	} else {
		x.Value = string(r.DecodeString())
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Dir = false
	} else {
		x.Dir = bool(r.DecodeBool())
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		if x.Expiration != nil {
			x.Expiration = nil
		}
	} else {
		if x.Expiration == nil {
			x.Expiration = new(time.Time)
		}
		z.DecFallback(x.Expiration, false)
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.TTL = 0
	} else {
		x.TTL = int64(r.DecodeInt(64))
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Nodes = nil
	} else {
		yyv61 := &x.Nodes
		yyv61.CodecDecodeSelf(d)
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.ModifiedIndex = 0
	} else {
		x.ModifiedIndex = uint64(r.DecodeUint(64))
	}
	yyj55++
	if yyhl55 {
		yyb55 = yyj55 > l
	} else {
		yyb55 = r.CheckBreak()
	}
	if yyb55 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.CreatedIndex = 0
	} else {
		x.CreatedIndex = uint64(r.DecodeUint(64))
	}
	for {
		yyj55++
		if yyhl55 {
			yyb55 = yyj55 > l
		} else {
			yyb55 = r.CheckBreak()
		}
		if yyb55 {
			break
		}
		if yyj55 > 1 {
			r.ReadArrayEntrySeparator()
		}
		z.DecStructFieldNotFound(yyj55-1, "")
	}
	r.ReadArrayEnd()
}
Esempio n. 12
0
func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer5311
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj10 int
	var yyb10 bool
	var yyhl10 bool = l >= 0
	yyj10++
	if yyhl10 {
		yyb10 = yyj10 > l
	} else {
		yyb10 = r.CheckBreak()
	}
	if yyb10 {
		r.ReadArrayEnd()
		return
	}
	if r.TryDecodeAsNil() {
		x.Action = ""
	} else {
		x.Action = string(r.DecodeString())
	}
	yyj10++
	if yyhl10 {
		yyb10 = yyj10 > l
	} else {
		yyb10 = r.CheckBreak()
	}
	if yyb10 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		if x.Node != nil {
			x.Node = nil
		}
	} else {
		if x.Node == nil {
			x.Node = new(Node)
		}
		x.Node.CodecDecodeSelf(d)
	}
	yyj10++
	if yyhl10 {
		yyb10 = yyj10 > l
	} else {
		yyb10 = r.CheckBreak()
	}
	if yyb10 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		if x.PrevNode != nil {
			x.PrevNode = nil
		}
	} else {
		if x.PrevNode == nil {
			x.PrevNode = new(Node)
		}
		x.PrevNode.CodecDecodeSelf(d)
	}
	for {
		yyj10++
		if yyhl10 {
			yyb10 = yyj10 > l
		} else {
			yyb10 = r.CheckBreak()
		}
		if yyb10 {
			break
		}
		if yyj10 > 1 {
			r.ReadArrayEntrySeparator()
		}
		z.DecStructFieldNotFound(yyj10-1, "")
	}
	r.ReadArrayEnd()
}
Esempio n. 13
0
func (x *responseType) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	*((*int)(x)) = int(r.DecodeInt(codecSelferBitsize4402))
}
Esempio n. 14
0
func (x *RawResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj10 int
	var yyb10 bool
	var yyhl10 bool = l >= 0
	yyj10++
	if yyhl10 {
		yyb10 = yyj10 > l
	} else {
		yyb10 = r.CheckBreak()
	}
	if yyb10 {
		r.ReadArrayEnd()
		return
	}
	if r.TryDecodeAsNil() {
		x.StatusCode = 0
	} else {
		x.StatusCode = int(r.DecodeInt(codecSelferBitsize4402))
	}
	yyj10++
	if yyhl10 {
		yyb10 = yyj10 > l
	} else {
		yyb10 = r.CheckBreak()
	}
	if yyb10 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Body = nil
	} else {
		yyv12 := &x.Body
		*yyv12 = r.DecodeBytes(*(*[]byte)(yyv12), false, false)
	}
	yyj10++
	if yyhl10 {
		yyb10 = yyj10 > l
	} else {
		yyb10 = r.CheckBreak()
	}
	if yyb10 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Header = nil
	} else {
		yyv13 := &x.Header
		h.dechttp_Header((*http.Header)(yyv13), d)
	}
	for {
		yyj10++
		if yyhl10 {
			yyb10 = yyj10 > l
		} else {
			yyb10 = r.CheckBreak()
		}
		if yyb10 {
			break
		}
		if yyj10 > 1 {
			r.ReadArrayEntrySeparator()
		}
		z.DecStructFieldNotFound(yyj10-1, "")
	}
	r.ReadArrayEnd()
}
Esempio n. 15
0
func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer5311
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj33 int
	var yyb33 bool
	var yyhl33 bool = l >= 0
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	if r.TryDecodeAsNil() {
		x.Key = ""
	} else {
		x.Key = string(r.DecodeString())
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Dir = false
	} else {
		x.Dir = bool(r.DecodeBool())
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Value = ""
	} else {
		x.Value = string(r.DecodeString())
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.Nodes = nil
	} else {
		yyv37 := &x.Nodes
		h.decSlicePtrtoNode((*[]*Node)(yyv37), d)
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.CreatedIndex = 0
	} else {
		x.CreatedIndex = uint64(r.DecodeUint(64))
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.ModifiedIndex = 0
	} else {
		x.ModifiedIndex = uint64(r.DecodeUint(64))
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		if x.Expiration != nil {
			x.Expiration = nil
		}
	} else {
		if x.Expiration == nil {
			x.Expiration = new(time.Time)
		}
		z.DecFallback(x.Expiration, false)
	}
	yyj33++
	if yyhl33 {
		yyb33 = yyj33 > l
	} else {
		yyb33 = r.CheckBreak()
	}
	if yyb33 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.TTL = 0
	} else {
		x.TTL = int64(r.DecodeInt(64))
	}
	for {
		yyj33++
		if yyhl33 {
			yyb33 = yyj33 > l
		} else {
			yyb33 = r.CheckBreak()
		}
		if yyb33 {
			break
		}
		if yyj33 > 1 {
			r.ReadArrayEntrySeparator()
		}
		z.DecStructFieldNotFound(yyj33-1, "")
	}
	r.ReadArrayEnd()
}
Esempio n. 16
0
func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj14 int
	var yyb14 bool
	var yyhl14 bool = l >= 0
	yyj14++
	if yyhl14 {
		yyb14 = yyj14 > l
	} else {
		yyb14 = r.CheckBreak()
	}
	if yyb14 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.Action = ""
	} else {
		x.Action = string(r.DecodeString())
	}
	yyj14++
	if yyhl14 {
		yyb14 = yyj14 > l
	} else {
		yyb14 = r.CheckBreak()
	}
	if yyb14 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		if x.Node != nil {
			x.Node = nil
		}
	} else {
		if x.Node == nil {
			x.Node = new(Node)
		}
		x.Node.CodecDecodeSelf(d)
	}
	yyj14++
	if yyhl14 {
		yyb14 = yyj14 > l
	} else {
		yyb14 = r.CheckBreak()
	}
	if yyb14 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		if x.PrevNode != nil {
			x.PrevNode = nil
		}
	} else {
		if x.PrevNode == nil {
			x.PrevNode = new(Node)
		}
		x.PrevNode.CodecDecodeSelf(d)
	}
	for {
		yyj14++
		if yyhl14 {
			yyb14 = yyj14 > l
		} else {
			yyb14 = r.CheckBreak()
		}
		if yyb14 {
			break
		}
		z.DecSendContainerState(codecSelfer_containerArrayElem1819)
		z.DecStructFieldNotFound(yyj14-1, "")
	}
	z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
}
Esempio n. 17
0
func (x codecSelfer5311) decSlicePtrtoNode(v *[]*Node, d *codec1978.Decoder) {
	var h codecSelfer5311
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r

	yyv43 := *v
	yyh43, yyl43 := z.DecSliceHelperStart()

	var yyc43 bool
	_ = yyc43

	if yyv43 == nil {
		if yyl43 <= 0 {
			yyv43 = make([]*Node, 0)
		} else {
			yyv43 = make([]*Node, yyl43)
		}
		yyc43 = true
	}

	if yyl43 == 0 {
		if len(yyv43) != 0 {
			yyv43 = yyv43[:0]
			yyc43 = true
		}
	} else if yyl43 > 0 {

		yyn43 := yyl43
		if yyl43 > cap(yyv43) {
			yyv43 = make([]*Node, yyl43, yyl43)
			yyc43 = true

		} else if yyl43 != len(yyv43) {
			yyv43 = yyv43[:yyl43]
			yyc43 = true
		}
		yyj43 := 0
		for ; yyj43 < yyn43; yyj43++ {
			if r.TryDecodeAsNil() {
				if yyv43[yyj43] != nil {
					*yyv43[yyj43] = Node{}
				}
			} else {
				if yyv43[yyj43] == nil {
					yyv43[yyj43] = new(Node)
				}
				yyw44 := yyv43[yyj43]
				yyw44.CodecDecodeSelf(d)
			}

		}

	} else {
		for yyj43 := 0; !r.CheckBreak(); yyj43++ {
			if yyj43 >= len(yyv43) {
				yyv43 = append(yyv43, nil) // var yyz43 *Node
				yyc43 = true
			}
			if yyj43 > 0 {
				yyh43.Sep(yyj43)
			}

			if yyj43 < len(yyv43) {
				if r.TryDecodeAsNil() {
					if yyv43[yyj43] != nil {
						*yyv43[yyj43] = Node{}
					}
				} else {
					if yyv43[yyj43] == nil {
						yyv43[yyj43] = new(Node)
					}
					yyw45 := yyv43[yyj43]
					yyw45.CodecDecodeSelf(d)
				}

			} else {
				z.DecSwallow()
			}

		}
		yyh43.End()
	}
	if yyc43 {
		*v = yyv43
	}

}
Esempio n. 18
0
func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys22Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys22Slc
	var yyhl22 bool = l >= 0
	for yyj22 := 0; ; yyj22++ {
		if yyhl22 {
			if yyj22 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
			if yyj22 > 0 {
				r.ReadMapEntrySeparator()
			}
		}
		yys22Slc = r.DecodeBytes(yys22Slc, true, true)
		yys22 := string(yys22Slc)
		if !yyhl22 {
			r.ReadMapKVSeparator()
		}
		switch yys22 {
		case "action":
			if r.TryDecodeAsNil() {
				x.Action = ""
			} else {
				x.Action = string(r.DecodeString())
			}
		case "node":
			if r.TryDecodeAsNil() {
				if x.Node != nil {
					x.Node = nil
				}
			} else {
				if x.Node == nil {
					x.Node = new(Node)
				}
				x.Node.CodecDecodeSelf(d)
			}
		case "prevNode":
			if r.TryDecodeAsNil() {
				if x.PrevNode != nil {
					x.PrevNode = nil
				}
			} else {
				if x.PrevNode == nil {
					x.PrevNode = new(Node)
				}
				x.PrevNode.CodecDecodeSelf(d)
			}
		case "etcdIndex":
			if r.TryDecodeAsNil() {
				x.EtcdIndex = 0
			} else {
				x.EtcdIndex = uint64(r.DecodeUint(64))
			}
		case "raftIndex":
			if r.TryDecodeAsNil() {
				x.RaftIndex = 0
			} else {
				x.RaftIndex = uint64(r.DecodeUint(64))
			}
		case "raftTerm":
			if r.TryDecodeAsNil() {
				x.RaftTerm = 0
			} else {
				x.RaftTerm = uint64(r.DecodeUint(64))
			}
		default:
			z.DecStructFieldNotFound(-1, yys22)
		} // end switch yys22
	} // end for yyj22
	if !yyhl22 {
		r.ReadMapEnd()
	}
}
Esempio n. 19
0
func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj57 int
	var yyb57 bool
	var yyhl57 bool = l >= 0
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.Key = ""
	} else {
		x.Key = string(r.DecodeString())
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.Dir = false
	} else {
		x.Dir = bool(r.DecodeBool())
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.Value = ""
	} else {
		x.Value = string(r.DecodeString())
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.Nodes = nil
	} else {
		yyv61 := &x.Nodes
		yyv61.CodecDecodeSelf(d)
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.CreatedIndex = 0
	} else {
		x.CreatedIndex = uint64(r.DecodeUint(64))
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.ModifiedIndex = 0
	} else {
		x.ModifiedIndex = uint64(r.DecodeUint(64))
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		if x.Expiration != nil {
			x.Expiration = nil
		}
	} else {
		if x.Expiration == nil {
			x.Expiration = new(time.Time)
		}
		yym65 := z.DecBinary()
		_ = yym65
		if false {
		} else if yym66 := z.TimeRtidIfBinc(); yym66 != 0 {
			r.DecodeBuiltin(yym66, x.Expiration)
		} else if z.HasExtensions() && z.DecExt(x.Expiration) {
		} else if yym65 {
			z.DecBinaryUnmarshal(x.Expiration)
		} else if !yym65 && z.IsJSONHandle() {
			z.DecJSONUnmarshal(x.Expiration)
		} else {
			z.DecFallback(x.Expiration, false)
		}
	}
	yyj57++
	if yyhl57 {
		yyb57 = yyj57 > l
	} else {
		yyb57 = r.CheckBreak()
	}
	if yyb57 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1819)
	if r.TryDecodeAsNil() {
		x.TTL = 0
	} else {
		x.TTL = int64(r.DecodeInt(64))
	}
	for {
		yyj57++
		if yyhl57 {
			yyb57 = yyj57 > l
		} else {
			yyb57 = r.CheckBreak()
		}
		if yyb57 {
			break
		}
		z.DecSendContainerState(codecSelfer_containerArrayElem1819)
		z.DecStructFieldNotFound(yyj57-1, "")
	}
	z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
}
Esempio n. 20
0
func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj29 int
	var yyb29 bool
	var yyhl29 bool = l >= 0
	yyj29++
	if yyhl29 {
		yyb29 = yyj29 > l
	} else {
		yyb29 = r.CheckBreak()
	}
	if yyb29 {
		r.ReadArrayEnd()
		return
	}
	if r.TryDecodeAsNil() {
		x.Action = ""
	} else {
		x.Action = string(r.DecodeString())
	}
	yyj29++
	if yyhl29 {
		yyb29 = yyj29 > l
	} else {
		yyb29 = r.CheckBreak()
	}
	if yyb29 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		if x.Node != nil {
			x.Node = nil
		}
	} else {
		if x.Node == nil {
			x.Node = new(Node)
		}
		x.Node.CodecDecodeSelf(d)
	}
	yyj29++
	if yyhl29 {
		yyb29 = yyj29 > l
	} else {
		yyb29 = r.CheckBreak()
	}
	if yyb29 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		if x.PrevNode != nil {
			x.PrevNode = nil
		}
	} else {
		if x.PrevNode == nil {
			x.PrevNode = new(Node)
		}
		x.PrevNode.CodecDecodeSelf(d)
	}
	yyj29++
	if yyhl29 {
		yyb29 = yyj29 > l
	} else {
		yyb29 = r.CheckBreak()
	}
	if yyb29 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.EtcdIndex = 0
	} else {
		x.EtcdIndex = uint64(r.DecodeUint(64))
	}
	yyj29++
	if yyhl29 {
		yyb29 = yyj29 > l
	} else {
		yyb29 = r.CheckBreak()
	}
	if yyb29 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.RaftIndex = 0
	} else {
		x.RaftIndex = uint64(r.DecodeUint(64))
	}
	yyj29++
	if yyhl29 {
		yyb29 = yyj29 > l
	} else {
		yyb29 = r.CheckBreak()
	}
	if yyb29 {
		r.ReadArrayEnd()
		return
	}
	r.ReadArrayEntrySeparator()
	if r.TryDecodeAsNil() {
		x.RaftTerm = 0
	} else {
		x.RaftTerm = uint64(r.DecodeUint(64))
	}
	for {
		yyj29++
		if yyhl29 {
			yyb29 = yyj29 > l
		} else {
			yyb29 = r.CheckBreak()
		}
		if yyb29 {
			break
		}
		if yyj29 > 1 {
			r.ReadArrayEntrySeparator()
		}
		z.DecStructFieldNotFound(yyj29-1, "")
	}
	r.ReadArrayEnd()
}
Esempio n. 21
0
func (x codecSelfer1819) decNodes(v *Nodes, d *codec1978.Decoder) {
	var h codecSelfer1819
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r

	yyv71 := *v
	yyh71, yyl71 := z.DecSliceHelperStart()
	var yyc71 bool
	if yyl71 == 0 {
		if yyv71 == nil {
			yyv71 = []*Node{}
			yyc71 = true
		} else if len(yyv71) != 0 {
			yyv71 = yyv71[:0]
			yyc71 = true
		}
	} else if yyl71 > 0 {
		var yyrr71, yyrl71 int
		var yyrt71 bool
		if yyl71 > cap(yyv71) {

			yyrg71 := len(yyv71) > 0
			yyv271 := yyv71
			yyrl71, yyrt71 = z.DecInferLen(yyl71, z.DecBasicHandle().MaxInitLen, 8)
			if yyrt71 {
				if yyrl71 <= cap(yyv71) {
					yyv71 = yyv71[:yyrl71]
				} else {
					yyv71 = make([]*Node, yyrl71)
				}
			} else {
				yyv71 = make([]*Node, yyrl71)
			}
			yyc71 = true
			yyrr71 = len(yyv71)
			if yyrg71 {
				copy(yyv71, yyv271)
			}
		} else if yyl71 != len(yyv71) {
			yyv71 = yyv71[:yyl71]
			yyc71 = true
		}
		yyj71 := 0
		for ; yyj71 < yyrr71; yyj71++ {
			yyh71.ElemContainerState(yyj71)
			if r.TryDecodeAsNil() {
				if yyv71[yyj71] != nil {
					*yyv71[yyj71] = Node{}
				}
			} else {
				if yyv71[yyj71] == nil {
					yyv71[yyj71] = new(Node)
				}
				yyw72 := yyv71[yyj71]
				yyw72.CodecDecodeSelf(d)
			}

		}
		if yyrt71 {
			for ; yyj71 < yyl71; yyj71++ {
				yyv71 = append(yyv71, nil)
				yyh71.ElemContainerState(yyj71)
				if r.TryDecodeAsNil() {
					if yyv71[yyj71] != nil {
						*yyv71[yyj71] = Node{}
					}
				} else {
					if yyv71[yyj71] == nil {
						yyv71[yyj71] = new(Node)
					}
					yyw73 := yyv71[yyj71]
					yyw73.CodecDecodeSelf(d)
				}

			}
		}

	} else {
		yyj71 := 0
		for ; !r.CheckBreak(); yyj71++ {

			if yyj71 >= len(yyv71) {
				yyv71 = append(yyv71, nil) // var yyz71 *Node
				yyc71 = true
			}
			yyh71.ElemContainerState(yyj71)
			if yyj71 < len(yyv71) {
				if r.TryDecodeAsNil() {
					if yyv71[yyj71] != nil {
						*yyv71[yyj71] = Node{}
					}
				} else {
					if yyv71[yyj71] == nil {
						yyv71[yyj71] = new(Node)
					}
					yyw74 := yyv71[yyj71]
					yyw74.CodecDecodeSelf(d)
				}

			} else {
				z.DecSwallow()
			}

		}
		if yyj71 < len(yyv71) {
			yyv71 = yyv71[:yyj71]
			yyc71 = true
		} else if yyj71 == 0 && yyv71 == nil {
			yyv71 = []*Node{}
			yyc71 = true
		}
	}
	yyh71.End()
	if yyc71 {
		*v = yyv71
	}
}
Esempio n. 22
0
func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer4402
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys46Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys46Slc
	var yyhl46 bool = l >= 0
	for yyj46 := 0; ; yyj46++ {
		if yyhl46 {
			if yyj46 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
			if yyj46 > 0 {
				r.ReadMapEntrySeparator()
			}
		}
		yys46Slc = r.DecodeBytes(yys46Slc, true, true)
		yys46 := string(yys46Slc)
		if !yyhl46 {
			r.ReadMapKVSeparator()
		}
		switch yys46 {
		case "key":
			if r.TryDecodeAsNil() {
				x.Key = ""
			} else {
				x.Key = string(r.DecodeString())
			}
		case "value":
			if r.TryDecodeAsNil() {
				x.Value = ""
			} else {
				x.Value = string(r.DecodeString())
			}
		case "dir":
			if r.TryDecodeAsNil() {
				x.Dir = false
			} else {
				x.Dir = bool(r.DecodeBool())
			}
		case "expiration":
			if r.TryDecodeAsNil() {
				if x.Expiration != nil {
					x.Expiration = nil
				}
			} else {
				if x.Expiration == nil {
					x.Expiration = new(time.Time)
				}
				z.DecFallback(x.Expiration, false)
			}
		case "ttl":
			if r.TryDecodeAsNil() {
				x.TTL = 0
			} else {
				x.TTL = int64(r.DecodeInt(64))
			}
		case "nodes":
			if r.TryDecodeAsNil() {
				x.Nodes = nil
			} else {
				yyv52 := &x.Nodes
				yyv52.CodecDecodeSelf(d)
			}
		case "modifiedIndex":
			if r.TryDecodeAsNil() {
				x.ModifiedIndex = 0
			} else {
				x.ModifiedIndex = uint64(r.DecodeUint(64))
			}
		case "createdIndex":
			if r.TryDecodeAsNil() {
				x.CreatedIndex = 0
			} else {
				x.CreatedIndex = uint64(r.DecodeUint(64))
			}
		default:
			z.DecStructFieldNotFound(-1, yys46)
		} // end switch yys46
	} // end for yyj46
	if !yyhl46 {
		r.ReadMapEnd()
	}
}
Esempio n. 23
0
func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer5311
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys6Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys6Slc
	var yyhl6 bool = l >= 0
	for yyj6 := 0; ; yyj6++ {
		if yyhl6 {
			if yyj6 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
			if yyj6 > 0 {
				r.ReadMapEntrySeparator()
			}
		}
		yys6Slc = r.DecodeBytes(yys6Slc, true, true)
		yys6 := string(yys6Slc)
		if !yyhl6 {
			r.ReadMapKVSeparator()
		}
		switch yys6 {
		case "action":
			if r.TryDecodeAsNil() {
				x.Action = ""
			} else {
				x.Action = string(r.DecodeString())
			}
		case "node":
			if r.TryDecodeAsNil() {
				if x.Node != nil {
					x.Node = nil
				}
			} else {
				if x.Node == nil {
					x.Node = new(Node)
				}
				x.Node.CodecDecodeSelf(d)
			}
		case "prevNode":
			if r.TryDecodeAsNil() {
				if x.PrevNode != nil {
					x.PrevNode = nil
				}
			} else {
				if x.PrevNode == nil {
					x.PrevNode = new(Node)
				}
				x.PrevNode.CodecDecodeSelf(d)
			}
		default:
			z.DecStructFieldNotFound(-1, yys6)
		} // end switch yys6
	} // end for yyj6
	if !yyhl6 {
		r.ReadMapEnd()
	}
}