1// Code generated by 'yaegi extract net/http'. DO NOT EDIT.
2
3// +build go1.16,!go1.17
4
5package stdlib
6
7import (
8	"bufio"
9	"go/constant"
10	"go/token"
11	"io/fs"
12	"net"
13	"net/http"
14	"net/url"
15	"reflect"
16)
17
18func init() {
19	Symbols["net/http/http"] = map[string]reflect.Value{
20		// function, constant and variable definitions
21		"CanonicalHeaderKey":                  reflect.ValueOf(http.CanonicalHeaderKey),
22		"DefaultClient":                       reflect.ValueOf(&http.DefaultClient).Elem(),
23		"DefaultMaxHeaderBytes":               reflect.ValueOf(constant.MakeFromLiteral("1048576", token.INT, 0)),
24		"DefaultMaxIdleConnsPerHost":          reflect.ValueOf(constant.MakeFromLiteral("2", token.INT, 0)),
25		"DefaultServeMux":                     reflect.ValueOf(&http.DefaultServeMux).Elem(),
26		"DefaultTransport":                    reflect.ValueOf(&http.DefaultTransport).Elem(),
27		"DetectContentType":                   reflect.ValueOf(http.DetectContentType),
28		"ErrAbortHandler":                     reflect.ValueOf(&http.ErrAbortHandler).Elem(),
29		"ErrBodyNotAllowed":                   reflect.ValueOf(&http.ErrBodyNotAllowed).Elem(),
30		"ErrBodyReadAfterClose":               reflect.ValueOf(&http.ErrBodyReadAfterClose).Elem(),
31		"ErrContentLength":                    reflect.ValueOf(&http.ErrContentLength).Elem(),
32		"ErrHandlerTimeout":                   reflect.ValueOf(&http.ErrHandlerTimeout).Elem(),
33		"ErrHeaderTooLong":                    reflect.ValueOf(&http.ErrHeaderTooLong).Elem(),
34		"ErrHijacked":                         reflect.ValueOf(&http.ErrHijacked).Elem(),
35		"ErrLineTooLong":                      reflect.ValueOf(&http.ErrLineTooLong).Elem(),
36		"ErrMissingBoundary":                  reflect.ValueOf(&http.ErrMissingBoundary).Elem(),
37		"ErrMissingContentLength":             reflect.ValueOf(&http.ErrMissingContentLength).Elem(),
38		"ErrMissingFile":                      reflect.ValueOf(&http.ErrMissingFile).Elem(),
39		"ErrNoCookie":                         reflect.ValueOf(&http.ErrNoCookie).Elem(),
40		"ErrNoLocation":                       reflect.ValueOf(&http.ErrNoLocation).Elem(),
41		"ErrNotMultipart":                     reflect.ValueOf(&http.ErrNotMultipart).Elem(),
42		"ErrNotSupported":                     reflect.ValueOf(&http.ErrNotSupported).Elem(),
43		"ErrServerClosed":                     reflect.ValueOf(&http.ErrServerClosed).Elem(),
44		"ErrShortBody":                        reflect.ValueOf(&http.ErrShortBody).Elem(),
45		"ErrSkipAltProtocol":                  reflect.ValueOf(&http.ErrSkipAltProtocol).Elem(),
46		"ErrUnexpectedTrailer":                reflect.ValueOf(&http.ErrUnexpectedTrailer).Elem(),
47		"ErrUseLastResponse":                  reflect.ValueOf(&http.ErrUseLastResponse).Elem(),
48		"ErrWriteAfterFlush":                  reflect.ValueOf(&http.ErrWriteAfterFlush).Elem(),
49		"Error":                               reflect.ValueOf(http.Error),
50		"FS":                                  reflect.ValueOf(http.FS),
51		"FileServer":                          reflect.ValueOf(http.FileServer),
52		"Get":                                 reflect.ValueOf(http.Get),
53		"Handle":                              reflect.ValueOf(http.Handle),
54		"HandleFunc":                          reflect.ValueOf(http.HandleFunc),
55		"Head":                                reflect.ValueOf(http.Head),
56		"ListenAndServe":                      reflect.ValueOf(http.ListenAndServe),
57		"ListenAndServeTLS":                   reflect.ValueOf(http.ListenAndServeTLS),
58		"LocalAddrContextKey":                 reflect.ValueOf(&http.LocalAddrContextKey).Elem(),
59		"MaxBytesReader":                      reflect.ValueOf(http.MaxBytesReader),
60		"MethodConnect":                       reflect.ValueOf(constant.MakeFromLiteral("\"CONNECT\"", token.STRING, 0)),
61		"MethodDelete":                        reflect.ValueOf(constant.MakeFromLiteral("\"DELETE\"", token.STRING, 0)),
62		"MethodGet":                           reflect.ValueOf(constant.MakeFromLiteral("\"GET\"", token.STRING, 0)),
63		"MethodHead":                          reflect.ValueOf(constant.MakeFromLiteral("\"HEAD\"", token.STRING, 0)),
64		"MethodOptions":                       reflect.ValueOf(constant.MakeFromLiteral("\"OPTIONS\"", token.STRING, 0)),
65		"MethodPatch":                         reflect.ValueOf(constant.MakeFromLiteral("\"PATCH\"", token.STRING, 0)),
66		"MethodPost":                          reflect.ValueOf(constant.MakeFromLiteral("\"POST\"", token.STRING, 0)),
67		"MethodPut":                           reflect.ValueOf(constant.MakeFromLiteral("\"PUT\"", token.STRING, 0)),
68		"MethodTrace":                         reflect.ValueOf(constant.MakeFromLiteral("\"TRACE\"", token.STRING, 0)),
69		"NewFileTransport":                    reflect.ValueOf(http.NewFileTransport),
70		"NewRequest":                          reflect.ValueOf(http.NewRequest),
71		"NewRequestWithContext":               reflect.ValueOf(http.NewRequestWithContext),
72		"NewServeMux":                         reflect.ValueOf(http.NewServeMux),
73		"NoBody":                              reflect.ValueOf(&http.NoBody).Elem(),
74		"NotFound":                            reflect.ValueOf(http.NotFound),
75		"NotFoundHandler":                     reflect.ValueOf(http.NotFoundHandler),
76		"ParseHTTPVersion":                    reflect.ValueOf(http.ParseHTTPVersion),
77		"ParseTime":                           reflect.ValueOf(http.ParseTime),
78		"Post":                                reflect.ValueOf(http.Post),
79		"PostForm":                            reflect.ValueOf(http.PostForm),
80		"ProxyFromEnvironment":                reflect.ValueOf(http.ProxyFromEnvironment),
81		"ProxyURL":                            reflect.ValueOf(http.ProxyURL),
82		"ReadRequest":                         reflect.ValueOf(http.ReadRequest),
83		"ReadResponse":                        reflect.ValueOf(http.ReadResponse),
84		"Redirect":                            reflect.ValueOf(http.Redirect),
85		"RedirectHandler":                     reflect.ValueOf(http.RedirectHandler),
86		"SameSiteDefaultMode":                 reflect.ValueOf(http.SameSiteDefaultMode),
87		"SameSiteLaxMode":                     reflect.ValueOf(http.SameSiteLaxMode),
88		"SameSiteNoneMode":                    reflect.ValueOf(http.SameSiteNoneMode),
89		"SameSiteStrictMode":                  reflect.ValueOf(http.SameSiteStrictMode),
90		"Serve":                               reflect.ValueOf(http.Serve),
91		"ServeContent":                        reflect.ValueOf(http.ServeContent),
92		"ServeFile":                           reflect.ValueOf(http.ServeFile),
93		"ServeTLS":                            reflect.ValueOf(http.ServeTLS),
94		"ServerContextKey":                    reflect.ValueOf(&http.ServerContextKey).Elem(),
95		"SetCookie":                           reflect.ValueOf(http.SetCookie),
96		"StateActive":                         reflect.ValueOf(http.StateActive),
97		"StateClosed":                         reflect.ValueOf(http.StateClosed),
98		"StateHijacked":                       reflect.ValueOf(http.StateHijacked),
99		"StateIdle":                           reflect.ValueOf(http.StateIdle),
100		"StateNew":                            reflect.ValueOf(http.StateNew),
101		"StatusAccepted":                      reflect.ValueOf(constant.MakeFromLiteral("202", token.INT, 0)),
102		"StatusAlreadyReported":               reflect.ValueOf(constant.MakeFromLiteral("208", token.INT, 0)),
103		"StatusBadGateway":                    reflect.ValueOf(constant.MakeFromLiteral("502", token.INT, 0)),
104		"StatusBadRequest":                    reflect.ValueOf(constant.MakeFromLiteral("400", token.INT, 0)),
105		"StatusConflict":                      reflect.ValueOf(constant.MakeFromLiteral("409", token.INT, 0)),
106		"StatusContinue":                      reflect.ValueOf(constant.MakeFromLiteral("100", token.INT, 0)),
107		"StatusCreated":                       reflect.ValueOf(constant.MakeFromLiteral("201", token.INT, 0)),
108		"StatusEarlyHints":                    reflect.ValueOf(constant.MakeFromLiteral("103", token.INT, 0)),
109		"StatusExpectationFailed":             reflect.ValueOf(constant.MakeFromLiteral("417", token.INT, 0)),
110		"StatusFailedDependency":              reflect.ValueOf(constant.MakeFromLiteral("424", token.INT, 0)),
111		"StatusForbidden":                     reflect.ValueOf(constant.MakeFromLiteral("403", token.INT, 0)),
112		"StatusFound":                         reflect.ValueOf(constant.MakeFromLiteral("302", token.INT, 0)),
113		"StatusGatewayTimeout":                reflect.ValueOf(constant.MakeFromLiteral("504", token.INT, 0)),
114		"StatusGone":                          reflect.ValueOf(constant.MakeFromLiteral("410", token.INT, 0)),
115		"StatusHTTPVersionNotSupported":       reflect.ValueOf(constant.MakeFromLiteral("505", token.INT, 0)),
116		"StatusIMUsed":                        reflect.ValueOf(constant.MakeFromLiteral("226", token.INT, 0)),
117		"StatusInsufficientStorage":           reflect.ValueOf(constant.MakeFromLiteral("507", token.INT, 0)),
118		"StatusInternalServerError":           reflect.ValueOf(constant.MakeFromLiteral("500", token.INT, 0)),
119		"StatusLengthRequired":                reflect.ValueOf(constant.MakeFromLiteral("411", token.INT, 0)),
120		"StatusLocked":                        reflect.ValueOf(constant.MakeFromLiteral("423", token.INT, 0)),
121		"StatusLoopDetected":                  reflect.ValueOf(constant.MakeFromLiteral("508", token.INT, 0)),
122		"StatusMethodNotAllowed":              reflect.ValueOf(constant.MakeFromLiteral("405", token.INT, 0)),
123		"StatusMisdirectedRequest":            reflect.ValueOf(constant.MakeFromLiteral("421", token.INT, 0)),
124		"StatusMovedPermanently":              reflect.ValueOf(constant.MakeFromLiteral("301", token.INT, 0)),
125		"StatusMultiStatus":                   reflect.ValueOf(constant.MakeFromLiteral("207", token.INT, 0)),
126		"StatusMultipleChoices":               reflect.ValueOf(constant.MakeFromLiteral("300", token.INT, 0)),
127		"StatusNetworkAuthenticationRequired": reflect.ValueOf(constant.MakeFromLiteral("511", token.INT, 0)),
128		"StatusNoContent":                     reflect.ValueOf(constant.MakeFromLiteral("204", token.INT, 0)),
129		"StatusNonAuthoritativeInfo":          reflect.ValueOf(constant.MakeFromLiteral("203", token.INT, 0)),
130		"StatusNotAcceptable":                 reflect.ValueOf(constant.MakeFromLiteral("406", token.INT, 0)),
131		"StatusNotExtended":                   reflect.ValueOf(constant.MakeFromLiteral("510", token.INT, 0)),
132		"StatusNotFound":                      reflect.ValueOf(constant.MakeFromLiteral("404", token.INT, 0)),
133		"StatusNotImplemented":                reflect.ValueOf(constant.MakeFromLiteral("501", token.INT, 0)),
134		"StatusNotModified":                   reflect.ValueOf(constant.MakeFromLiteral("304", token.INT, 0)),
135		"StatusOK":                            reflect.ValueOf(constant.MakeFromLiteral("200", token.INT, 0)),
136		"StatusPartialContent":                reflect.ValueOf(constant.MakeFromLiteral("206", token.INT, 0)),
137		"StatusPaymentRequired":               reflect.ValueOf(constant.MakeFromLiteral("402", token.INT, 0)),
138		"StatusPermanentRedirect":             reflect.ValueOf(constant.MakeFromLiteral("308", token.INT, 0)),
139		"StatusPreconditionFailed":            reflect.ValueOf(constant.MakeFromLiteral("412", token.INT, 0)),
140		"StatusPreconditionRequired":          reflect.ValueOf(constant.MakeFromLiteral("428", token.INT, 0)),
141		"StatusProcessing":                    reflect.ValueOf(constant.MakeFromLiteral("102", token.INT, 0)),
142		"StatusProxyAuthRequired":             reflect.ValueOf(constant.MakeFromLiteral("407", token.INT, 0)),
143		"StatusRequestEntityTooLarge":         reflect.ValueOf(constant.MakeFromLiteral("413", token.INT, 0)),
144		"StatusRequestHeaderFieldsTooLarge":   reflect.ValueOf(constant.MakeFromLiteral("431", token.INT, 0)),
145		"StatusRequestTimeout":                reflect.ValueOf(constant.MakeFromLiteral("408", token.INT, 0)),
146		"StatusRequestURITooLong":             reflect.ValueOf(constant.MakeFromLiteral("414", token.INT, 0)),
147		"StatusRequestedRangeNotSatisfiable":  reflect.ValueOf(constant.MakeFromLiteral("416", token.INT, 0)),
148		"StatusResetContent":                  reflect.ValueOf(constant.MakeFromLiteral("205", token.INT, 0)),
149		"StatusSeeOther":                      reflect.ValueOf(constant.MakeFromLiteral("303", token.INT, 0)),
150		"StatusServiceUnavailable":            reflect.ValueOf(constant.MakeFromLiteral("503", token.INT, 0)),
151		"StatusSwitchingProtocols":            reflect.ValueOf(constant.MakeFromLiteral("101", token.INT, 0)),
152		"StatusTeapot":                        reflect.ValueOf(constant.MakeFromLiteral("418", token.INT, 0)),
153		"StatusTemporaryRedirect":             reflect.ValueOf(constant.MakeFromLiteral("307", token.INT, 0)),
154		"StatusText":                          reflect.ValueOf(http.StatusText),
155		"StatusTooEarly":                      reflect.ValueOf(constant.MakeFromLiteral("425", token.INT, 0)),
156		"StatusTooManyRequests":               reflect.ValueOf(constant.MakeFromLiteral("429", token.INT, 0)),
157		"StatusUnauthorized":                  reflect.ValueOf(constant.MakeFromLiteral("401", token.INT, 0)),
158		"StatusUnavailableForLegalReasons":    reflect.ValueOf(constant.MakeFromLiteral("451", token.INT, 0)),
159		"StatusUnprocessableEntity":           reflect.ValueOf(constant.MakeFromLiteral("422", token.INT, 0)),
160		"StatusUnsupportedMediaType":          reflect.ValueOf(constant.MakeFromLiteral("415", token.INT, 0)),
161		"StatusUpgradeRequired":               reflect.ValueOf(constant.MakeFromLiteral("426", token.INT, 0)),
162		"StatusUseProxy":                      reflect.ValueOf(constant.MakeFromLiteral("305", token.INT, 0)),
163		"StatusVariantAlsoNegotiates":         reflect.ValueOf(constant.MakeFromLiteral("506", token.INT, 0)),
164		"StripPrefix":                         reflect.ValueOf(http.StripPrefix),
165		"TimeFormat":                          reflect.ValueOf(constant.MakeFromLiteral("\"Mon, 02 Jan 2006 15:04:05 GMT\"", token.STRING, 0)),
166		"TimeoutHandler":                      reflect.ValueOf(http.TimeoutHandler),
167		"TrailerPrefix":                       reflect.ValueOf(constant.MakeFromLiteral("\"Trailer:\"", token.STRING, 0)),
168
169		// type definitions
170		"Client":         reflect.ValueOf((*http.Client)(nil)),
171		"CloseNotifier":  reflect.ValueOf((*http.CloseNotifier)(nil)),
172		"ConnState":      reflect.ValueOf((*http.ConnState)(nil)),
173		"Cookie":         reflect.ValueOf((*http.Cookie)(nil)),
174		"CookieJar":      reflect.ValueOf((*http.CookieJar)(nil)),
175		"Dir":            reflect.ValueOf((*http.Dir)(nil)),
176		"File":           reflect.ValueOf((*http.File)(nil)),
177		"FileSystem":     reflect.ValueOf((*http.FileSystem)(nil)),
178		"Flusher":        reflect.ValueOf((*http.Flusher)(nil)),
179		"Handler":        reflect.ValueOf((*http.Handler)(nil)),
180		"HandlerFunc":    reflect.ValueOf((*http.HandlerFunc)(nil)),
181		"Header":         reflect.ValueOf((*http.Header)(nil)),
182		"Hijacker":       reflect.ValueOf((*http.Hijacker)(nil)),
183		"ProtocolError":  reflect.ValueOf((*http.ProtocolError)(nil)),
184		"PushOptions":    reflect.ValueOf((*http.PushOptions)(nil)),
185		"Pusher":         reflect.ValueOf((*http.Pusher)(nil)),
186		"Request":        reflect.ValueOf((*http.Request)(nil)),
187		"Response":       reflect.ValueOf((*http.Response)(nil)),
188		"ResponseWriter": reflect.ValueOf((*http.ResponseWriter)(nil)),
189		"RoundTripper":   reflect.ValueOf((*http.RoundTripper)(nil)),
190		"SameSite":       reflect.ValueOf((*http.SameSite)(nil)),
191		"ServeMux":       reflect.ValueOf((*http.ServeMux)(nil)),
192		"Server":         reflect.ValueOf((*http.Server)(nil)),
193		"Transport":      reflect.ValueOf((*http.Transport)(nil)),
194
195		// interface wrapper definitions
196		"_CloseNotifier":  reflect.ValueOf((*_net_http_CloseNotifier)(nil)),
197		"_CookieJar":      reflect.ValueOf((*_net_http_CookieJar)(nil)),
198		"_File":           reflect.ValueOf((*_net_http_File)(nil)),
199		"_FileSystem":     reflect.ValueOf((*_net_http_FileSystem)(nil)),
200		"_Flusher":        reflect.ValueOf((*_net_http_Flusher)(nil)),
201		"_Handler":        reflect.ValueOf((*_net_http_Handler)(nil)),
202		"_Hijacker":       reflect.ValueOf((*_net_http_Hijacker)(nil)),
203		"_Pusher":         reflect.ValueOf((*_net_http_Pusher)(nil)),
204		"_ResponseWriter": reflect.ValueOf((*_net_http_ResponseWriter)(nil)),
205		"_RoundTripper":   reflect.ValueOf((*_net_http_RoundTripper)(nil)),
206	}
207}
208
209// _net_http_CloseNotifier is an interface wrapper for CloseNotifier type
210type _net_http_CloseNotifier struct {
211	IValue       interface{}
212	WCloseNotify func() <-chan bool
213}
214
215func (W _net_http_CloseNotifier) CloseNotify() <-chan bool {
216	return W.WCloseNotify()
217}
218
219// _net_http_CookieJar is an interface wrapper for CookieJar type
220type _net_http_CookieJar struct {
221	IValue      interface{}
222	WCookies    func(u *url.URL) []*http.Cookie
223	WSetCookies func(u *url.URL, cookies []*http.Cookie)
224}
225
226func (W _net_http_CookieJar) Cookies(u *url.URL) []*http.Cookie {
227	return W.WCookies(u)
228}
229func (W _net_http_CookieJar) SetCookies(u *url.URL, cookies []*http.Cookie) {
230	W.WSetCookies(u, cookies)
231}
232
233// _net_http_File is an interface wrapper for File type
234type _net_http_File struct {
235	IValue   interface{}
236	WClose   func() error
237	WRead    func(p []byte) (n int, err error)
238	WReaddir func(count int) ([]fs.FileInfo, error)
239	WSeek    func(offset int64, whence int) (int64, error)
240	WStat    func() (fs.FileInfo, error)
241}
242
243func (W _net_http_File) Close() error {
244	return W.WClose()
245}
246func (W _net_http_File) Read(p []byte) (n int, err error) {
247	return W.WRead(p)
248}
249func (W _net_http_File) Readdir(count int) ([]fs.FileInfo, error) {
250	return W.WReaddir(count)
251}
252func (W _net_http_File) Seek(offset int64, whence int) (int64, error) {
253	return W.WSeek(offset, whence)
254}
255func (W _net_http_File) Stat() (fs.FileInfo, error) {
256	return W.WStat()
257}
258
259// _net_http_FileSystem is an interface wrapper for FileSystem type
260type _net_http_FileSystem struct {
261	IValue interface{}
262	WOpen  func(name string) (http.File, error)
263}
264
265func (W _net_http_FileSystem) Open(name string) (http.File, error) {
266	return W.WOpen(name)
267}
268
269// _net_http_Flusher is an interface wrapper for Flusher type
270type _net_http_Flusher struct {
271	IValue interface{}
272	WFlush func()
273}
274
275func (W _net_http_Flusher) Flush() {
276	W.WFlush()
277}
278
279// _net_http_Handler is an interface wrapper for Handler type
280type _net_http_Handler struct {
281	IValue     interface{}
282	WServeHTTP func(a0 http.ResponseWriter, a1 *http.Request)
283}
284
285func (W _net_http_Handler) ServeHTTP(a0 http.ResponseWriter, a1 *http.Request) {
286	W.WServeHTTP(a0, a1)
287}
288
289// _net_http_Hijacker is an interface wrapper for Hijacker type
290type _net_http_Hijacker struct {
291	IValue  interface{}
292	WHijack func() (net.Conn, *bufio.ReadWriter, error)
293}
294
295func (W _net_http_Hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) {
296	return W.WHijack()
297}
298
299// _net_http_Pusher is an interface wrapper for Pusher type
300type _net_http_Pusher struct {
301	IValue interface{}
302	WPush  func(target string, opts *http.PushOptions) error
303}
304
305func (W _net_http_Pusher) Push(target string, opts *http.PushOptions) error {
306	return W.WPush(target, opts)
307}
308
309// _net_http_ResponseWriter is an interface wrapper for ResponseWriter type
310type _net_http_ResponseWriter struct {
311	IValue       interface{}
312	WHeader      func() http.Header
313	WWrite       func(a0 []byte) (int, error)
314	WWriteHeader func(statusCode int)
315}
316
317func (W _net_http_ResponseWriter) Header() http.Header {
318	return W.WHeader()
319}
320func (W _net_http_ResponseWriter) Write(a0 []byte) (int, error) {
321	return W.WWrite(a0)
322}
323func (W _net_http_ResponseWriter) WriteHeader(statusCode int) {
324	W.WWriteHeader(statusCode)
325}
326
327// _net_http_RoundTripper is an interface wrapper for RoundTripper type
328type _net_http_RoundTripper struct {
329	IValue     interface{}
330	WRoundTrip func(a0 *http.Request) (*http.Response, error)
331}
332
333func (W _net_http_RoundTripper) RoundTrip(a0 *http.Request) (*http.Response, error) {
334	return W.WRoundTrip(a0)
335}
336