Skip to content

Commit 226ffe8

Browse files
authored
Generate ugorji stuff (#176)
ugorji/go#130
1 parent 030e7b3 commit 226ffe8

3 files changed

Lines changed: 5397 additions & 0 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// ************************************************************
2+
// DO NOT EDIT.
3+
// THIS FILE IS AUTO-GENERATED BY codecgen.
4+
// ************************************************************
5+
6+
package v1alpha1
7+
8+
import (
9+
"errors"
10+
"fmt"
11+
"reflect"
12+
"runtime"
13+
14+
codec1978 "github.com/ugorji/go/codec"
15+
)
16+
17+
const (
18+
// ----- content types ----
19+
codecSelferC_UTF81206 = 1
20+
codecSelferC_RAW1206 = 0
21+
// ----- value types used ----
22+
codecSelferValueTypeArray1206 = 10
23+
codecSelferValueTypeMap1206 = 9
24+
// ----- containerStateValues ----
25+
codecSelfer_containerMapKey1206 = 2
26+
codecSelfer_containerMapValue1206 = 3
27+
codecSelfer_containerMapEnd1206 = 4
28+
codecSelfer_containerArrayElem1206 = 6
29+
codecSelfer_containerArrayEnd1206 = 7
30+
)
31+
32+
var (
33+
codecSelferBitsize1206 = uint8(reflect.TypeOf(uint(0)).Bits())
34+
codecSelferOnlyMapOrArrayEncodeToStructErr1206 = errors.New(`only encoded map or array can be decoded into a struct`)
35+
)
36+
37+
type codecSelfer1206 struct{}
38+
39+
func init() {
40+
if codec1978.GenVersion != 5 {
41+
_, file, _, _ := runtime.Caller(0)
42+
err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v",
43+
5, codec1978.GenVersion, file)
44+
panic(err)
45+
}
46+
if false { // reference the types, but skip this branch at build/run time
47+
}
48+
}
49+
50+
func (x PrefixType) CodecEncodeSelf(e *codec1978.Encoder) {
51+
var h codecSelfer1206
52+
z, r := codec1978.GenHelperEncoder(e)
53+
_, _, _ = h, z, r
54+
yym1 := z.EncBinary()
55+
_ = yym1
56+
if false {
57+
} else if z.HasExtensions() && z.EncExt(x) {
58+
} else if !yym1 && z.IsJSONHandle() {
59+
z.EncJSONMarshal(x)
60+
} else {
61+
r.EncodeInt(int64(x))
62+
}
63+
}
64+
65+
func (x *PrefixType) CodecDecodeSelf(d *codec1978.Decoder) {
66+
var h codecSelfer1206
67+
z, r := codec1978.GenHelperDecoder(d)
68+
_, _, _ = h, z, r
69+
yym1 := z.DecBinary()
70+
_ = yym1
71+
if false {
72+
} else if z.HasExtensions() && z.DecExt(x) {
73+
} else if !yym1 && z.IsJSONHandle() {
74+
z.DecJSONUnmarshal(x)
75+
} else {
76+
*((*int)(x)) = int(r.DecodeInt(codecSelferBitsize1206))
77+
}
78+
}

0 commit comments

Comments
 (0)