Source file
src/net/http/omithttp2.go
1
2
3
4
5
6
7
8 package http
9
10 import (
11 "errors"
12 "sync"
13 "time"
14 )
15
16 func init() {
17 omitBundledHTTP2 = true
18 }
19
20 const noHTTP2 = "no bundled HTTP/2"
21
22 var http2errRequestCanceled = errors.New("net/http: request canceled")
23
24 var http2goAwayTimeout = 1 * time.Second
25
26 const http2NextProtoTLS = "h2"
27
28 type http2Transport struct {
29 MaxHeaderListSize uint32
30 ConnPool interface{}
31 }
32
33 func (*http2Transport) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }
34 func (*http2Transport) CloseIdleConnections() {}
35
36 type http2noDialH2RoundTripper struct{}
37
38 func (http2noDialH2RoundTripper) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }
39
40 type http2noDialClientConnPool struct {
41 http2clientConnPool http2clientConnPool
42 }
43
44 type http2clientConnPool struct {
45 mu *sync.Mutex
46 conns map[string][]struct{}
47 }
48
49 func http2configureTransports(*Transport) (*http2Transport, error) { panic(noHTTP2) }
50
51 func http2isNoCachedConnError(err error) bool {
52 _, ok := err.(interface{ IsHTTP2NoCachedConnError() })
53 return ok
54 }
55
56 type http2Server struct {
57 NewWriteScheduler func() http2WriteScheduler
58 }
59
60 type http2WriteScheduler interface{}
61
62 func http2NewPriorityWriteScheduler(interface{}) http2WriteScheduler { panic(noHTTP2) }
63
64 func http2ConfigureServer(s *Server, conf *http2Server) error { panic(noHTTP2) }
65
66 var http2ErrNoCachedConn = http2noCachedConnError{}
67
68 type http2noCachedConnError struct{}
69
70 func (http2noCachedConnError) IsHTTP2NoCachedConnError() {}
71
72 func (http2noCachedConnError) Error() string { return "http2: no cached connection was available" }
73
View as plain text