11package  lars
22
33import  (
4- 	"context" 
54	"encoding/json" 
65	"encoding/xml" 
76	"io" 
87	"net" 
98	"net/http" 
109	"strings" 
11- 	"time" 
1210
1311	"github.com/gorilla/websocket" 
1412)
@@ -24,45 +22,6 @@ type Param struct {
2422// It is therefore safe to read values by the index. 
2523type  Params  []Param 
2624
27- // Context is the context interface type 
28- type  Context  interface  {
29- 	context.Context 
30- 	Request () * http.Request 
31- 	Response () * Response 
32- 	WebSocket () * websocket.Conn 
33- 	Param (name  string ) string 
34- 	ParseForm () error 
35- 	ParseMultipartForm (maxMemory  int64 ) error 
36- 	Set (key  interface {}, value  interface {})
37- 	Get (key  interface {}) (value  interface {}, exists  bool )
38- 	Context () context.Context 
39- 	WithContext (context.Context )
40- 	WithCancel () context.CancelFunc 
41- 	WithDeadline (time.Time ) context.CancelFunc 
42- 	WithTimeout (time.Duration ) context.CancelFunc 
43- 	WithValue (key  interface {}, val  interface {})
44- 	Next ()
45- 	RequestStart (w  http.ResponseWriter , r  * http.Request )
46- 	RequestEnd ()
47- 	ClientIP () (clientIP  string )
48- 	AcceptedLanguages (lowercase  bool ) []string 
49- 	HandlerName () string 
50- 	Stream (step  func (w  io.Writer ) bool )
51- 	JSON (int , interface {}) error 
52- 	JSONBytes (int , []byte ) error 
53- 	JSONP (int , interface {}, string ) error 
54- 	XML (int , interface {}) error 
55- 	XMLBytes (int , []byte ) error 
56- 	Text (int , string ) error 
57- 	TextBytes (int , []byte ) error 
58- 	Attachment (r  io.Reader , filename  string ) (err  error )
59- 	Inline (r  io.Reader , filename  string ) (err  error )
60- 	Decode (includeFormQueryParams  bool , maxMemory  int64 , v  interface {}) (err  error )
61- 	BaseContext () * Ctx 
62- }
63- 
64- var  _  context.Context  =  & Ctx {}
65- 
6625// NewContext returns a new default lars Context object. 
6726func  NewContext (l  * LARS ) * Ctx  {
6827
0 commit comments