This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
deprecated.go
81 lines (70 loc) · 2.33 KB
/
deprecated.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
package kwiscale
import (
"log"
"net/http"
"net/url"
)
// Deprecated functions that will disapear
// GetApp returns the app that holds this handler.
//
// DEPRECATED -- see App()
func (b *BaseHandler) GetApp() *App {
log.Println("[WARN] GetApp() is deprecated, please use App() method instead.")
return b.App()
}
// GetResponse returns the current response.
//
// DEPRECATED -- see Response()
func (b *BaseHandler) GetResponse() http.ResponseWriter {
log.Println("[WARN] GetResponse() is deprecated, please use Response() method instead.")
return b.Response()
}
// GetRequest returns the current request.
//
// DEPRECATED -- see Request()
func (b *BaseHandler) GetRequest() *http.Request {
log.Println("[WARN] GetRequest() is deprecated, please use Request() method instead.")
return b.Request()
}
// GetPost return the post data for the given "name" argument.
//
// DEPRECATED -- see PostVar()
func (b *BaseHandler) GetPost(name string) string {
log.Println("[WARN] GetPost() is deprecated, please use PostValue() method instead.")
return b.PostValue(name, "")
}
// GetURL return an url based on the declared route and given string pair.
//
// DEPRECATED -- see URL()
func (b *BaseHandler) GetURL(s ...string) (*url.URL, error) {
log.Println("[WARN] GetURL() is deprecated, please use URL() method instead.")
return b.URL(s...)
}
// GetPayload returns the Body content.
//
// DEPRECATED - see Payload()
func (b *BaseHandler) GetPayload() []byte {
log.Println("[WARN] GetPauload() is deprecated, please use Payload() method instead.")
return b.Payload()
}
// GetPostValues returns the entire posted values.
//
// DEPRECATED - see PostValues()
func (b *BaseHandler) GetPostValues() url.Values {
log.Println("[WARN] GetPostValues() is deprecated, please use PostValues() method instead.")
return b.PostValues()
}
// GetJSONPayload unmarshal body to the "v" interface.
//
// DEPRECATED - see JSONPayload()
func (b *BaseHandler) GetJSONPayload(v interface{}) error {
log.Println("[WARN] GetJSONPayload() is deprecated, please use JSONPayload() method instead.")
return b.JSONPayload(v)
}
// GlobalCtx Returns global template context.
//
// Deprecated: use handler.App().Context instead
func (b *RequestHandler) GlobalCtx() map[string]interface{} {
log.Println("[WARN] GlobalCtx() is deprecated, please use App().Context instead.")
return b.App().Context
}