Upgrade dependencies
This commit is contained in:
parent
d6d795e286
commit
83e09acc9f
177 changed files with 59841 additions and 39358 deletions
256
vendor/github.com/ugorji/go/codec/gen-helper.generated.go
generated
vendored
256
vendor/github.com/ugorji/go/codec/gen-helper.generated.go
generated
vendored
|
@ -1,12 +1,9 @@
|
|||
// //+build ignore
|
||||
/* // +build ignore */
|
||||
|
||||
// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.
|
||||
// Use of this source code is governed by a MIT license found in the LICENSE file.
|
||||
|
||||
// ************************************************************
|
||||
// DO NOT EDIT.
|
||||
// THIS FILE IS AUTO-GENERATED from gen-helper.go.tmpl
|
||||
// ************************************************************
|
||||
// Code generated from gen-helper.go.tmpl - DO NOT EDIT.
|
||||
|
||||
package codec
|
||||
|
||||
|
@ -15,9 +12,12 @@ import (
|
|||
"reflect"
|
||||
)
|
||||
|
||||
// GenVersion is the current version of codecgen.
|
||||
const GenVersion = 8
|
||||
|
||||
// This file is used to generate helper code for codecgen.
|
||||
// The values here i.e. genHelper(En|De)coder are not to be used directly by
|
||||
// library users. They WILL change continously and without notice.
|
||||
// library users. They WILL change continuously and without notice.
|
||||
//
|
||||
// To help enforce this, we create an unexported type with exported members.
|
||||
// The only way to get the type is via the one exported type that we control (somewhat).
|
||||
|
@ -26,25 +26,75 @@ import (
|
|||
// to perform encoding or decoding of primitives or known slice or map types.
|
||||
|
||||
// GenHelperEncoder is exported so that it can be used externally by codecgen.
|
||||
//
|
||||
// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
|
||||
func GenHelperEncoder(e *Encoder) (genHelperEncoder, encDriver) {
|
||||
return genHelperEncoder{e: e}, e.e
|
||||
func GenHelperEncoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) {
|
||||
ge = genHelperEncoder{e: e}
|
||||
ee = genHelperEncDriver{encDriver: e.e}
|
||||
return
|
||||
}
|
||||
|
||||
// GenHelperDecoder is exported so that it can be used externally by codecgen.
|
||||
//
|
||||
// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
|
||||
func GenHelperDecoder(d *Decoder) (genHelperDecoder, decDriver) {
|
||||
return genHelperDecoder{d: d}, d.d
|
||||
func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) {
|
||||
gd = genHelperDecoder{d: d}
|
||||
dd = genHelperDecDriver{decDriver: d.d}
|
||||
return
|
||||
}
|
||||
|
||||
type genHelperEncDriver struct {
|
||||
encDriver
|
||||
}
|
||||
|
||||
func (x genHelperEncDriver) EncodeBuiltin(rt uintptr, v interface{}) {}
|
||||
func (x genHelperEncDriver) EncStructFieldKey(keyType valueType, s string) {
|
||||
encStructFieldKey(x.encDriver, keyType, s)
|
||||
}
|
||||
func (x genHelperEncDriver) EncodeSymbol(s string) {
|
||||
x.encDriver.EncodeString(cUTF8, s)
|
||||
}
|
||||
|
||||
type genHelperDecDriver struct {
|
||||
decDriver
|
||||
C checkOverflow
|
||||
}
|
||||
|
||||
func (x genHelperDecDriver) DecodeBuiltin(rt uintptr, v interface{}) {}
|
||||
func (x genHelperDecDriver) DecStructFieldKey(keyType valueType, buf *[decScratchByteArrayLen]byte) []byte {
|
||||
return decStructFieldKey(x.decDriver, keyType, buf)
|
||||
}
|
||||
func (x genHelperDecDriver) DecodeInt(bitsize uint8) (i int64) {
|
||||
return x.C.IntV(x.decDriver.DecodeInt64(), bitsize)
|
||||
}
|
||||
func (x genHelperDecDriver) DecodeUint(bitsize uint8) (ui uint64) {
|
||||
return x.C.UintV(x.decDriver.DecodeUint64(), bitsize)
|
||||
}
|
||||
func (x genHelperDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) {
|
||||
f = x.DecodeFloat64()
|
||||
if chkOverflow32 && chkOvf.Float32(f) {
|
||||
panicv.errorf("float32 overflow: %v", f)
|
||||
}
|
||||
return
|
||||
}
|
||||
func (x genHelperDecDriver) DecodeFloat32As64() (f float64) {
|
||||
f = x.DecodeFloat64()
|
||||
if chkOvf.Float32(f) {
|
||||
panicv.errorf("float32 overflow: %v", f)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
type genHelperEncoder struct {
|
||||
M must
|
||||
e *Encoder
|
||||
F fastpathT
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
type genHelperDecoder struct {
|
||||
C checkOverflow
|
||||
d *Decoder
|
||||
F fastpathT
|
||||
}
|
||||
|
@ -59,69 +109,86 @@ func (f genHelperEncoder) EncBinary() bool {
|
|||
return f.e.be // f.e.hh.isBinaryEncoding()
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncFallback(iv interface{}) {
|
||||
// println(">>>>>>>>> EncFallback")
|
||||
f.e.encodeI(iv, false, false)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) {
|
||||
bs, fnerr := iv.MarshalText()
|
||||
f.e.marshal(bs, fnerr, false, c_UTF8)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) {
|
||||
bs, fnerr := iv.MarshalJSON()
|
||||
f.e.marshal(bs, fnerr, true, c_UTF8)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {
|
||||
bs, fnerr := iv.MarshalBinary()
|
||||
f.e.marshal(bs, fnerr, false, c_RAW)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) TimeRtidIfBinc() uintptr {
|
||||
if _, ok := f.e.hh.(*BincHandle); ok {
|
||||
return timeTypId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) IsJSONHandle() bool {
|
||||
return f.e.js
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncFallback(iv interface{}) {
|
||||
// println(">>>>>>>>> EncFallback")
|
||||
// f.e.encodeI(iv, false, false)
|
||||
f.e.encodeValue(reflect.ValueOf(iv), nil, false)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) {
|
||||
bs, fnerr := iv.MarshalText()
|
||||
f.e.marshal(bs, fnerr, false, cUTF8)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) {
|
||||
bs, fnerr := iv.MarshalJSON()
|
||||
f.e.marshal(bs, fnerr, true, cUTF8)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {
|
||||
bs, fnerr := iv.MarshalBinary()
|
||||
f.e.marshal(bs, fnerr, false, cRAW)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncRaw(iv Raw) { f.e.rawBytes(iv) }
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
//
|
||||
// Deprecated: builtin no longer supported - so we make this method a no-op,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperEncoder) TimeRtidIfBinc() (v uintptr) { return }
|
||||
|
||||
// func (f genHelperEncoder) TimeRtidIfBinc() uintptr {
|
||||
// if _, ok := f.e.hh.(*BincHandle); ok {
|
||||
// return timeTypId
|
||||
// }
|
||||
// }
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) I2Rtid(v interface{}) uintptr {
|
||||
return i2rtid(v)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
|
||||
return f.e.h.getExt(rtid)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncExtension(v interface{}, xfFn *extTypeTagFn) {
|
||||
f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
//
|
||||
// Deprecated: No longer used,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperEncoder) HasExtensions() bool {
|
||||
return len(f.e.h.extHandle) != 0
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
//
|
||||
// Deprecated: No longer used,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperEncoder) EncExt(v interface{}) (r bool) {
|
||||
rt := reflect.TypeOf(v)
|
||||
if rt.Kind() == reflect.Ptr {
|
||||
rt = rt.Elem()
|
||||
}
|
||||
rtid := reflect.ValueOf(rt).Pointer()
|
||||
if xfFn := f.e.h.getExt(rtid); xfFn != nil {
|
||||
if xfFn := f.e.h.getExt(i2rtid(v)); xfFn != nil {
|
||||
f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperEncoder) EncSendContainerState(c containerState) {
|
||||
if f.e.cr != nil {
|
||||
f.e.cr.sendContainerState(c)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- DECODER FOLLOWS -----------------
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
|
@ -135,19 +202,27 @@ func (f genHelperDecoder) DecBinary() bool {
|
|||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecSwallow() {
|
||||
f.d.swallow()
|
||||
}
|
||||
func (f genHelperDecoder) DecSwallow() { f.d.swallow() }
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecScratchBuffer() []byte {
|
||||
return f.d.b[:]
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecScratchArrayBuffer() *[decScratchByteArrayLen]byte {
|
||||
return &f.d.b
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) {
|
||||
// println(">>>>>>>>> DecFallback")
|
||||
f.d.decodeI(iv, chkPtr, false, false, false)
|
||||
rv := reflect.ValueOf(iv)
|
||||
if chkPtr {
|
||||
rv = f.d.ensureDecodeable(rv)
|
||||
}
|
||||
f.d.decodeValue(rv, nil, false)
|
||||
// f.d.decodeValueFallback(rv)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
|
@ -167,7 +242,7 @@ func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) {
|
|||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) {
|
||||
fnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true))
|
||||
fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes())
|
||||
if fnerr != nil {
|
||||
panic(fnerr)
|
||||
}
|
||||
|
@ -175,7 +250,7 @@ func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) {
|
|||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) {
|
||||
// bs := f.dd.DecodeBytes(f.d.b[:], true, true)
|
||||
// bs := f.dd.DecodeStringAsBytes()
|
||||
// grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.
|
||||
fnerr := tm.UnmarshalJSON(f.d.nextValueBytes())
|
||||
if fnerr != nil {
|
||||
|
@ -185,19 +260,28 @@ func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) {
|
|||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) {
|
||||
fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, false, true))
|
||||
fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, true))
|
||||
if fnerr != nil {
|
||||
panic(fnerr)
|
||||
}
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) TimeRtidIfBinc() uintptr {
|
||||
if _, ok := f.d.hh.(*BincHandle); ok {
|
||||
return timeTypId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (f genHelperDecoder) DecRaw() []byte { return f.d.rawBytes() }
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
//
|
||||
// Deprecated: builtin no longer supported - so we make this method a no-op,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperDecoder) TimeRtidIfBinc() (v uintptr) { return }
|
||||
|
||||
// func (f genHelperDecoder) TimeRtidIfBinc() uintptr {
|
||||
// // Note: builtin is no longer supported - so make this a no-op
|
||||
// if _, ok := f.d.hh.(*BincHandle); ok {
|
||||
// return timeTypId
|
||||
// }
|
||||
// return 0
|
||||
// }
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) IsJSONHandle() bool {
|
||||
|
@ -205,15 +289,34 @@ func (f genHelperDecoder) IsJSONHandle() bool {
|
|||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) I2Rtid(v interface{}) uintptr {
|
||||
return i2rtid(v)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
|
||||
return f.d.h.getExt(rtid)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecExtension(v interface{}, xfFn *extTypeTagFn) {
|
||||
f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
//
|
||||
// Deprecated: No longer used,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperDecoder) HasExtensions() bool {
|
||||
return len(f.d.h.extHandle) != 0
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
//
|
||||
// Deprecated: No longer used,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperDecoder) DecExt(v interface{}) (r bool) {
|
||||
rt := reflect.TypeOf(v).Elem()
|
||||
rtid := reflect.ValueOf(rt).Pointer()
|
||||
if xfFn := f.d.h.getExt(rtid); xfFn != nil {
|
||||
if xfFn := f.d.h.getExt(i2rtid(v)); xfFn != nil {
|
||||
f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext)
|
||||
return true
|
||||
}
|
||||
|
@ -221,13 +324,12 @@ func (f genHelperDecoder) DecExt(v interface{}) (r bool) {
|
|||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) {
|
||||
func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int) {
|
||||
return decInferLen(clen, maxlen, unit)
|
||||
}
|
||||
|
||||
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
|
||||
func (f genHelperDecoder) DecSendContainerState(c containerState) {
|
||||
if f.d.cr != nil {
|
||||
f.d.cr.sendContainerState(c)
|
||||
}
|
||||
}
|
||||
//
|
||||
// Deprecated: no longer used,
|
||||
// but leave in-place so that old generated files continue to work without regeneration.
|
||||
func (f genHelperDecoder) StringView(v []byte) string { return stringView(v) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue