コード例 #1
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)
		}
	}
}
コード例 #2
0
func (x *RawResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer1978
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys16Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys16Slc
	var yyhl16 bool = l >= 0
	for yyj16 := 0; ; yyj16++ {
		if yyhl16 {
			if yyj16 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
		}
		z.DecSendContainerState(codecSelfer_containerMapKey1978)
		yys16Slc = r.DecodeBytes(yys16Slc, true, true)
		yys16 := string(yys16Slc)
		z.DecSendContainerState(codecSelfer_containerMapValue1978)
		switch yys16 {
		case "StatusCode":
			if r.TryDecodeAsNil() {
				x.StatusCode = 0
			} else {
				x.StatusCode = int(r.DecodeInt(codecSelferBitsize1978))
			}
		case "Body":
			if r.TryDecodeAsNil() {
				x.Body = nil
			} else {
				yyv18 := &x.Body
				yym19 := z.DecBinary()
				_ = yym19
				if false {
				} else {
					*yyv18 = r.DecodeBytes(*(*[]byte)(yyv18), false, false)
				}
			}
		case "Header":
			if r.TryDecodeAsNil() {
				x.Header = nil
			} else {
				yyv20 := &x.Header
				yym21 := z.DecBinary()
				_ = yym21
				if false {
				} else if z.HasExtensions() && z.DecExt(yyv20) {
				} else {
					h.dechttp_Header((*pkg1_http.Header)(yyv20), d)
				}
			}
		default:
			z.DecStructFieldNotFound(-1, yys16)
		} // end switch yys16
	} // end for yyj16
	z.DecSendContainerState(codecSelfer_containerMapEnd1978)
}
コード例 #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)
}
コード例 #4
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)
	}
}
コード例 #5
0
func (x *responseType) CodecDecodeSelf(d *codec1978.Decoder) {
	var h codecSelfer1978
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	yym2 := z.DecBinary()
	_ = yym2
	if false {
	} else if z.HasExtensions() && z.DecExt(x) {
	} else {
		*((*int)(x)) = int(r.DecodeInt(codecSelferBitsize1978))
	}
}
コード例 #6
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
	}
}
コード例 #7
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)
}
コード例 #8
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)
}
コード例 #9
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)
}
コード例 #10
0
func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer1978
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj53 int
	var yyb53 bool
	var yyhl53 bool = l >= 0
	yyj53++
	if yyhl53 {
		yyb53 = yyj53 > l
	} else {
		yyb53 = r.CheckBreak()
	}
	if yyb53 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.Action = ""
	} else {
		x.Action = string(r.DecodeString())
	}
	yyj53++
	if yyhl53 {
		yyb53 = yyj53 > l
	} else {
		yyb53 = r.CheckBreak()
	}
	if yyb53 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		if x.Node != nil {
			x.Node = nil
		}
	} else {
		if x.Node == nil {
			x.Node = new(Node)
		}
		x.Node.CodecDecodeSelf(d)
	}
	yyj53++
	if yyhl53 {
		yyb53 = yyj53 > l
	} else {
		yyb53 = r.CheckBreak()
	}
	if yyb53 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		if x.PrevNode != nil {
			x.PrevNode = nil
		}
	} else {
		if x.PrevNode == nil {
			x.PrevNode = new(Node)
		}
		x.PrevNode.CodecDecodeSelf(d)
	}
	yyj53++
	if yyhl53 {
		yyb53 = yyj53 > l
	} else {
		yyb53 = r.CheckBreak()
	}
	if yyb53 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.EtcdIndex = 0
	} else {
		x.EtcdIndex = uint64(r.DecodeUint(64))
	}
	yyj53++
	if yyhl53 {
		yyb53 = yyj53 > l
	} else {
		yyb53 = r.CheckBreak()
	}
	if yyb53 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.RaftIndex = 0
	} else {
		x.RaftIndex = uint64(r.DecodeUint(64))
	}
	yyj53++
	if yyhl53 {
		yyb53 = yyj53 > l
	} else {
		yyb53 = r.CheckBreak()
	}
	if yyb53 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.RaftTerm = 0
	} else {
		x.RaftTerm = uint64(r.DecodeUint(64))
	}
	for {
		yyj53++
		if yyhl53 {
			yyb53 = yyj53 > l
		} else {
			yyb53 = r.CheckBreak()
		}
		if yyb53 {
			break
		}
		z.DecSendContainerState(codecSelfer_containerArrayElem1978)
		z.DecStructFieldNotFound(yyj53-1, "")
	}
	z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
}
コード例 #11
0
func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer1978
	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_containerMapKey1978)
		yys46Slc = r.DecodeBytes(yys46Slc, true, true)
		yys46 := string(yys46Slc)
		z.DecSendContainerState(codecSelfer_containerMapValue1978)
		switch yys46 {
		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, yys46)
		} // end switch yys46
	} // end for yyj46
	z.DecSendContainerState(codecSelfer_containerMapEnd1978)
}
コード例 #12
0
func (x *RawResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer1978
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj22 int
	var yyb22 bool
	var yyhl22 bool = l >= 0
	yyj22++
	if yyhl22 {
		yyb22 = yyj22 > l
	} else {
		yyb22 = r.CheckBreak()
	}
	if yyb22 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.StatusCode = 0
	} else {
		x.StatusCode = int(r.DecodeInt(codecSelferBitsize1978))
	}
	yyj22++
	if yyhl22 {
		yyb22 = yyj22 > l
	} else {
		yyb22 = r.CheckBreak()
	}
	if yyb22 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.Body = nil
	} else {
		yyv24 := &x.Body
		yym25 := z.DecBinary()
		_ = yym25
		if false {
		} else {
			*yyv24 = r.DecodeBytes(*(*[]byte)(yyv24), false, false)
		}
	}
	yyj22++
	if yyhl22 {
		yyb22 = yyj22 > l
	} else {
		yyb22 = r.CheckBreak()
	}
	if yyb22 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1978)
	if r.TryDecodeAsNil() {
		x.Header = nil
	} else {
		yyv26 := &x.Header
		yym27 := z.DecBinary()
		_ = yym27
		if false {
		} else if z.HasExtensions() && z.DecExt(yyv26) {
		} else {
			h.dechttp_Header((*pkg1_http.Header)(yyv26), d)
		}
	}
	for {
		yyj22++
		if yyhl22 {
			yyb22 = yyj22 > l
		} else {
			yyb22 = r.CheckBreak()
		}
		if yyb22 {
			break
		}
		z.DecSendContainerState(codecSelfer_containerArrayElem1978)
		z.DecStructFieldNotFound(yyj22-1, "")
	}
	z.DecSendContainerState(codecSelfer_containerArrayEnd1978)
}
コード例 #13
0
func (x codecSelfer1978) decNodes(v *Nodes, d *codec1978.Decoder) {
	var h codecSelfer1978
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r

	yyv123 := *v
	yyh123, yyl123 := z.DecSliceHelperStart()
	var yyc123 bool
	if yyl123 == 0 {
		if yyv123 == nil {
			yyv123 = []*Node{}
			yyc123 = true
		} else if len(yyv123) != 0 {
			yyv123 = yyv123[:0]
			yyc123 = true
		}
	} else if yyl123 > 0 {
		var yyrr123, yyrl123 int
		var yyrt123 bool
		if yyl123 > cap(yyv123) {

			yyrg123 := len(yyv123) > 0
			yyv2123 := yyv123
			yyrl123, yyrt123 = z.DecInferLen(yyl123, z.DecBasicHandle().MaxInitLen, 8)
			if yyrt123 {
				if yyrl123 <= cap(yyv123) {
					yyv123 = yyv123[:yyrl123]
				} else {
					yyv123 = make([]*Node, yyrl123)
				}
			} else {
				yyv123 = make([]*Node, yyrl123)
			}
			yyc123 = true
			yyrr123 = len(yyv123)
			if yyrg123 {
				copy(yyv123, yyv2123)
			}
		} else if yyl123 != len(yyv123) {
			yyv123 = yyv123[:yyl123]
			yyc123 = true
		}
		yyj123 := 0
		for ; yyj123 < yyrr123; yyj123++ {
			yyh123.ElemContainerState(yyj123)
			if r.TryDecodeAsNil() {
				if yyv123[yyj123] != nil {
					*yyv123[yyj123] = Node{}
				}
			} else {
				if yyv123[yyj123] == nil {
					yyv123[yyj123] = new(Node)
				}
				yyw124 := yyv123[yyj123]
				yyw124.CodecDecodeSelf(d)
			}

		}
		if yyrt123 {
			for ; yyj123 < yyl123; yyj123++ {
				yyv123 = append(yyv123, nil)
				yyh123.ElemContainerState(yyj123)
				if r.TryDecodeAsNil() {
					if yyv123[yyj123] != nil {
						*yyv123[yyj123] = Node{}
					}
				} else {
					if yyv123[yyj123] == nil {
						yyv123[yyj123] = new(Node)
					}
					yyw125 := yyv123[yyj123]
					yyw125.CodecDecodeSelf(d)
				}

			}
		}

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

			if yyj123 >= len(yyv123) {
				yyv123 = append(yyv123, nil) // var yyz123 *Node
				yyc123 = true
			}
			yyh123.ElemContainerState(yyj123)
			if yyj123 < len(yyv123) {
				if r.TryDecodeAsNil() {
					if yyv123[yyj123] != nil {
						*yyv123[yyj123] = Node{}
					}
				} else {
					if yyv123[yyj123] == nil {
						yyv123[yyj123] = new(Node)
					}
					yyw126 := yyv123[yyj123]
					yyw126.CodecDecodeSelf(d)
				}

			} else {
				z.DecSwallow()
			}

		}
		if yyj123 < len(yyv123) {
			yyv123 = yyv123[:yyj123]
			yyc123 = true
		} else if yyj123 == 0 && yyv123 == nil {
			yyv123 = []*Node{}
			yyc123 = true
		}
	}
	yyh123.End()
	if yyc123 {
		*v = yyv123
	}
}
コード例 #14
0
func (x codecSelfer1978) dechttp_Header(v *pkg1_http.Header, d *codec1978.Decoder) {
	var h codecSelfer1978
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r

	yyv115 := *v
	yyl115 := r.ReadMapStart()
	yybh115 := z.DecBasicHandle()
	if yyv115 == nil {
		yyrl115, _ := z.DecInferLen(yyl115, yybh115.MaxInitLen, 40)
		yyv115 = make(map[string][]string, yyrl115)
		*v = yyv115
	}
	var yymk115 string
	var yymv115 []string
	var yymg115 bool
	if yybh115.MapValueReset {
		yymg115 = true
	}
	if yyl115 > 0 {
		for yyj115 := 0; yyj115 < yyl115; yyj115++ {
			z.DecSendContainerState(codecSelfer_containerMapKey1978)
			if r.TryDecodeAsNil() {
				yymk115 = ""
			} else {
				yymk115 = string(r.DecodeString())
			}

			if yymg115 {
				yymv115 = yyv115[yymk115]
			} else {
				yymv115 = nil
			}
			z.DecSendContainerState(codecSelfer_containerMapValue1978)
			if r.TryDecodeAsNil() {
				yymv115 = nil
			} else {
				yyv117 := &yymv115
				yym118 := z.DecBinary()
				_ = yym118
				if false {
				} else {
					z.F.DecSliceStringX(yyv117, false, d)
				}
			}

			if yyv115 != nil {
				yyv115[yymk115] = yymv115
			}
		}
	} else if yyl115 < 0 {
		for yyj115 := 0; !r.CheckBreak(); yyj115++ {
			z.DecSendContainerState(codecSelfer_containerMapKey1978)
			if r.TryDecodeAsNil() {
				yymk115 = ""
			} else {
				yymk115 = string(r.DecodeString())
			}

			if yymg115 {
				yymv115 = yyv115[yymk115]
			} else {
				yymv115 = nil
			}
			z.DecSendContainerState(codecSelfer_containerMapValue1978)
			if r.TryDecodeAsNil() {
				yymv115 = nil
			} else {
				yyv120 := &yymv115
				yym121 := z.DecBinary()
				_ = yym121
				if false {
				} else {
					z.F.DecSliceStringX(yyv120, false, d)
				}
			}

			if yyv115 != nil {
				yyv115[yymk115] = yymv115
			}
		}
	} // else len==0: TODO: Should we clear map entries?
	z.DecSendContainerState(codecSelfer_containerMapEnd1978)
}