-
Notifications
You must be signed in to change notification settings - Fork 94
/
io.go
324 lines (300 loc) · 11 KB
/
io.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
// this file was generated by gomacro command: import _b "io"
// DO NOT EDIT! Any change will be lost when the file is re-generated
package imports
import (
. "reflect"
io "io"
)
// reflection: allow interpreted code to import "io"
func init() {
Packages["io"] = Package{
Name: "io",
Binds: map[string]Value{
"Copy": ValueOf(io.Copy),
"CopyBuffer": ValueOf(io.CopyBuffer),
"CopyN": ValueOf(io.CopyN),
"EOF": ValueOf(&io.EOF).Elem(),
"ErrClosedPipe": ValueOf(&io.ErrClosedPipe).Elem(),
"ErrNoProgress": ValueOf(&io.ErrNoProgress).Elem(),
"ErrShortBuffer": ValueOf(&io.ErrShortBuffer).Elem(),
"ErrShortWrite": ValueOf(&io.ErrShortWrite).Elem(),
"ErrUnexpectedEOF": ValueOf(&io.ErrUnexpectedEOF).Elem(),
"LimitReader": ValueOf(io.LimitReader),
"MultiReader": ValueOf(io.MultiReader),
"MultiWriter": ValueOf(io.MultiWriter),
"NewSectionReader": ValueOf(io.NewSectionReader),
"Pipe": ValueOf(io.Pipe),
"ReadAtLeast": ValueOf(io.ReadAtLeast),
"ReadFull": ValueOf(io.ReadFull),
"SeekCurrent": ValueOf(io.SeekCurrent),
"SeekEnd": ValueOf(io.SeekEnd),
"SeekStart": ValueOf(io.SeekStart),
"TeeReader": ValueOf(io.TeeReader),
"WriteString": ValueOf(io.WriteString),
}, Types: map[string]Type{
"ByteReader": TypeOf((*io.ByteReader)(nil)).Elem(),
"ByteScanner": TypeOf((*io.ByteScanner)(nil)).Elem(),
"ByteWriter": TypeOf((*io.ByteWriter)(nil)).Elem(),
"Closer": TypeOf((*io.Closer)(nil)).Elem(),
"LimitedReader": TypeOf((*io.LimitedReader)(nil)).Elem(),
"PipeReader": TypeOf((*io.PipeReader)(nil)).Elem(),
"PipeWriter": TypeOf((*io.PipeWriter)(nil)).Elem(),
"ReadCloser": TypeOf((*io.ReadCloser)(nil)).Elem(),
"ReadSeeker": TypeOf((*io.ReadSeeker)(nil)).Elem(),
"ReadWriteCloser": TypeOf((*io.ReadWriteCloser)(nil)).Elem(),
"ReadWriteSeeker": TypeOf((*io.ReadWriteSeeker)(nil)).Elem(),
"ReadWriter": TypeOf((*io.ReadWriter)(nil)).Elem(),
"Reader": TypeOf((*io.Reader)(nil)).Elem(),
"ReaderAt": TypeOf((*io.ReaderAt)(nil)).Elem(),
"ReaderFrom": TypeOf((*io.ReaderFrom)(nil)).Elem(),
"RuneReader": TypeOf((*io.RuneReader)(nil)).Elem(),
"RuneScanner": TypeOf((*io.RuneScanner)(nil)).Elem(),
"SectionReader": TypeOf((*io.SectionReader)(nil)).Elem(),
"Seeker": TypeOf((*io.Seeker)(nil)).Elem(),
"StringWriter": TypeOf((*io.StringWriter)(nil)).Elem(),
"WriteCloser": TypeOf((*io.WriteCloser)(nil)).Elem(),
"WriteSeeker": TypeOf((*io.WriteSeeker)(nil)).Elem(),
"Writer": TypeOf((*io.Writer)(nil)).Elem(),
"WriterAt": TypeOf((*io.WriterAt)(nil)).Elem(),
"WriterTo": TypeOf((*io.WriterTo)(nil)).Elem(),
}, Proxies: map[string]Type{
"ByteReader": TypeOf((*P_io_ByteReader)(nil)).Elem(),
"ByteScanner": TypeOf((*P_io_ByteScanner)(nil)).Elem(),
"ByteWriter": TypeOf((*P_io_ByteWriter)(nil)).Elem(),
"Closer": TypeOf((*P_io_Closer)(nil)).Elem(),
"ReadCloser": TypeOf((*P_io_ReadCloser)(nil)).Elem(),
"ReadSeeker": TypeOf((*P_io_ReadSeeker)(nil)).Elem(),
"ReadWriteCloser": TypeOf((*P_io_ReadWriteCloser)(nil)).Elem(),
"ReadWriteSeeker": TypeOf((*P_io_ReadWriteSeeker)(nil)).Elem(),
"ReadWriter": TypeOf((*P_io_ReadWriter)(nil)).Elem(),
"Reader": TypeOf((*P_io_Reader)(nil)).Elem(),
"ReaderAt": TypeOf((*P_io_ReaderAt)(nil)).Elem(),
"ReaderFrom": TypeOf((*P_io_ReaderFrom)(nil)).Elem(),
"RuneReader": TypeOf((*P_io_RuneReader)(nil)).Elem(),
"RuneScanner": TypeOf((*P_io_RuneScanner)(nil)).Elem(),
"Seeker": TypeOf((*P_io_Seeker)(nil)).Elem(),
"StringWriter": TypeOf((*P_io_StringWriter)(nil)).Elem(),
"WriteCloser": TypeOf((*P_io_WriteCloser)(nil)).Elem(),
"WriteSeeker": TypeOf((*P_io_WriteSeeker)(nil)).Elem(),
"Writer": TypeOf((*P_io_Writer)(nil)).Elem(),
"WriterAt": TypeOf((*P_io_WriterAt)(nil)).Elem(),
"WriterTo": TypeOf((*P_io_WriterTo)(nil)).Elem(),
}, Untypeds: map[string]string{
"SeekCurrent": "int:1",
"SeekEnd": "int:2",
"SeekStart": "int:0",
},
}
}
// --------------- proxy for io.ByteReader ---------------
type P_io_ByteReader struct {
Object interface{}
ReadByte_ func(interface{}) (byte, error)
}
func (P *P_io_ByteReader) ReadByte() (byte, error) {
return P.ReadByte_(P.Object)
}
// --------------- proxy for io.ByteScanner ---------------
type P_io_ByteScanner struct {
Object interface{}
ReadByte_ func(interface{}) (byte, error)
UnreadByte_ func(interface{}) error
}
func (P *P_io_ByteScanner) ReadByte() (byte, error) {
return P.ReadByte_(P.Object)
}
func (P *P_io_ByteScanner) UnreadByte() error {
return P.UnreadByte_(P.Object)
}
// --------------- proxy for io.ByteWriter ---------------
type P_io_ByteWriter struct {
Object interface{}
WriteByte_ func(_proxy_obj_ interface{}, c byte) error
}
func (P *P_io_ByteWriter) WriteByte(c byte) error {
return P.WriteByte_(P.Object, c)
}
// --------------- proxy for io.Closer ---------------
type P_io_Closer struct {
Object interface{}
Close_ func(interface{}) error
}
func (P *P_io_Closer) Close() error {
return P.Close_(P.Object)
}
// --------------- proxy for io.ReadCloser ---------------
type P_io_ReadCloser struct {
Object interface{}
Close_ func(interface{}) error
Read_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_ReadCloser) Close() error {
return P.Close_(P.Object)
}
func (P *P_io_ReadCloser) Read(p []byte) (n int, err error) {
return P.Read_(P.Object, p)
}
// --------------- proxy for io.ReadSeeker ---------------
type P_io_ReadSeeker struct {
Object interface{}
Read_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
Seek_ func(_proxy_obj_ interface{}, offset int64, whence int) (int64, error)
}
func (P *P_io_ReadSeeker) Read(p []byte) (n int, err error) {
return P.Read_(P.Object, p)
}
func (P *P_io_ReadSeeker) Seek(offset int64, whence int) (int64, error) {
return P.Seek_(P.Object, offset, whence)
}
// --------------- proxy for io.ReadWriteCloser ---------------
type P_io_ReadWriteCloser struct {
Object interface{}
Close_ func(interface{}) error
Read_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
Write_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_ReadWriteCloser) Close() error {
return P.Close_(P.Object)
}
func (P *P_io_ReadWriteCloser) Read(p []byte) (n int, err error) {
return P.Read_(P.Object, p)
}
func (P *P_io_ReadWriteCloser) Write(p []byte) (n int, err error) {
return P.Write_(P.Object, p)
}
// --------------- proxy for io.ReadWriteSeeker ---------------
type P_io_ReadWriteSeeker struct {
Object interface{}
Read_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
Seek_ func(_proxy_obj_ interface{}, offset int64, whence int) (int64, error)
Write_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_ReadWriteSeeker) Read(p []byte) (n int, err error) {
return P.Read_(P.Object, p)
}
func (P *P_io_ReadWriteSeeker) Seek(offset int64, whence int) (int64, error) {
return P.Seek_(P.Object, offset, whence)
}
func (P *P_io_ReadWriteSeeker) Write(p []byte) (n int, err error) {
return P.Write_(P.Object, p)
}
// --------------- proxy for io.ReadWriter ---------------
type P_io_ReadWriter struct {
Object interface{}
Read_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
Write_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_ReadWriter) Read(p []byte) (n int, err error) {
return P.Read_(P.Object, p)
}
func (P *P_io_ReadWriter) Write(p []byte) (n int, err error) {
return P.Write_(P.Object, p)
}
// --------------- proxy for io.Reader ---------------
type P_io_Reader struct {
Object interface{}
Read_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_Reader) Read(p []byte) (n int, err error) {
return P.Read_(P.Object, p)
}
// --------------- proxy for io.ReaderAt ---------------
type P_io_ReaderAt struct {
Object interface{}
ReadAt_ func(_proxy_obj_ interface{}, p []byte, off int64) (n int, err error)
}
func (P *P_io_ReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
return P.ReadAt_(P.Object, p, off)
}
// --------------- proxy for io.ReaderFrom ---------------
type P_io_ReaderFrom struct {
Object interface{}
ReadFrom_ func(_proxy_obj_ interface{}, r io.Reader) (n int64, err error)
}
func (P *P_io_ReaderFrom) ReadFrom(r io.Reader) (n int64, err error) {
return P.ReadFrom_(P.Object, r)
}
// --------------- proxy for io.RuneReader ---------------
type P_io_RuneReader struct {
Object interface{}
ReadRune_ func(interface{}) (r rune, size int, err error)
}
func (P *P_io_RuneReader) ReadRune() (r rune, size int, err error) {
return P.ReadRune_(P.Object)
}
// --------------- proxy for io.RuneScanner ---------------
type P_io_RuneScanner struct {
Object interface{}
ReadRune_ func(interface{}) (r rune, size int, err error)
UnreadRune_ func(interface{}) error
}
func (P *P_io_RuneScanner) ReadRune() (r rune, size int, err error) {
return P.ReadRune_(P.Object)
}
func (P *P_io_RuneScanner) UnreadRune() error {
return P.UnreadRune_(P.Object)
}
// --------------- proxy for io.Seeker ---------------
type P_io_Seeker struct {
Object interface{}
Seek_ func(_proxy_obj_ interface{}, offset int64, whence int) (int64, error)
}
func (P *P_io_Seeker) Seek(offset int64, whence int) (int64, error) {
return P.Seek_(P.Object, offset, whence)
}
// --------------- proxy for io.StringWriter ---------------
type P_io_StringWriter struct {
Object interface{}
WriteString_ func(_proxy_obj_ interface{}, s string) (n int, err error)
}
func (P *P_io_StringWriter) WriteString(s string) (n int, err error) {
return P.WriteString_(P.Object, s)
}
// --------------- proxy for io.WriteCloser ---------------
type P_io_WriteCloser struct {
Object interface{}
Close_ func(interface{}) error
Write_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_WriteCloser) Close() error {
return P.Close_(P.Object)
}
func (P *P_io_WriteCloser) Write(p []byte) (n int, err error) {
return P.Write_(P.Object, p)
}
// --------------- proxy for io.WriteSeeker ---------------
type P_io_WriteSeeker struct {
Object interface{}
Seek_ func(_proxy_obj_ interface{}, offset int64, whence int) (int64, error)
Write_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_WriteSeeker) Seek(offset int64, whence int) (int64, error) {
return P.Seek_(P.Object, offset, whence)
}
func (P *P_io_WriteSeeker) Write(p []byte) (n int, err error) {
return P.Write_(P.Object, p)
}
// --------------- proxy for io.Writer ---------------
type P_io_Writer struct {
Object interface{}
Write_ func(_proxy_obj_ interface{}, p []byte) (n int, err error)
}
func (P *P_io_Writer) Write(p []byte) (n int, err error) {
return P.Write_(P.Object, p)
}
// --------------- proxy for io.WriterAt ---------------
type P_io_WriterAt struct {
Object interface{}
WriteAt_ func(_proxy_obj_ interface{}, p []byte, off int64) (n int, err error)
}
func (P *P_io_WriterAt) WriteAt(p []byte, off int64) (n int, err error) {
return P.WriteAt_(P.Object, p, off)
}
// --------------- proxy for io.WriterTo ---------------
type P_io_WriterTo struct {
Object interface{}
WriteTo_ func(_proxy_obj_ interface{}, w io.Writer) (n int64, err error)
}
func (P *P_io_WriterTo) WriteTo(w io.Writer) (n int64, err error) {
return P.WriteTo_(P.Object, w)
}