forked from cuelang/cue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkg.go
73 lines (67 loc) · 1.51 KB
/
pkg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Code generated by go generate. DO NOT EDIT.
//go:generate rm pkg.go
//go:generate go run ../../gen/gen.go
package base64
import (
"github.com/solo-io/cue/internal/core/adt"
"github.com/solo-io/cue/pkg/internal"
)
func init() {
internal.Register("encoding/base64", pkg)
}
var _ = adt.TopKind // in case the adt package isn't used
var pkg = &internal.Package{
Native: []*internal.Builtin{{
Name: "EncodedLen",
Params: []internal.Param{
{Kind: adt.TopKind},
{Kind: adt.IntKind},
},
Result: adt.IntKind,
Func: func(c *internal.CallCtxt) {
encoding, n := c.Value(0), c.Int(1)
if c.Do() {
c.Ret, c.Err = EncodedLen(encoding, n)
}
},
}, {
Name: "DecodedLen",
Params: []internal.Param{
{Kind: adt.TopKind},
{Kind: adt.IntKind},
},
Result: adt.IntKind,
Func: func(c *internal.CallCtxt) {
encoding, x := c.Value(0), c.Int(1)
if c.Do() {
c.Ret, c.Err = DecodedLen(encoding, x)
}
},
}, {
Name: "Encode",
Params: []internal.Param{
{Kind: adt.TopKind},
{Kind: adt.BytesKind | adt.StringKind},
},
Result: adt.StringKind,
Func: func(c *internal.CallCtxt) {
encoding, src := c.Value(0), c.Bytes(1)
if c.Do() {
c.Ret, c.Err = Encode(encoding, src)
}
},
}, {
Name: "Decode",
Params: []internal.Param{
{Kind: adt.TopKind},
{Kind: adt.StringKind},
},
Result: adt.BytesKind | adt.StringKind,
Func: func(c *internal.CallCtxt) {
encoding, s := c.Value(0), c.String(1)
if c.Do() {
c.Ret, c.Err = Decode(encoding, s)
}
},
}},
}