Commit Graph

122 Commits

Author SHA1 Message Date
David Irvine
ebe3580daf Add convenience method to check if websockets required (#779)
* Add convenience method to check if websockets required

* Add tests

* Fix up tests for develop branch
2017-01-02 16:05:30 +08:00
Bo-Yi Wu
5cc3d5955f Support upload single or multiple files.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-12-24 12:25:01 +08:00
Javier Provecho Fernandez
2cab17ba50 Merge pull request #701 from maxatome/patch-1
Context.Get() does not need to test whether Keys is nil or not
2016-12-06 20:39:01 +01:00
Bo-Yi Wu
764e138e32 Merge pull request #755 from gin-gonic/755-app-engine-client-ip
Fix #723
2016-12-06 08:14:11 -06:00
Javier Provecho Fernandez
7e58c80a7c Fix #723 2016-12-06 14:28:01 +01:00
Javier Provecho Fernandez
273e43a27a Merge pull request #724 from chiffa-org/redundant_context_import
Move golang.org/x/net/context.Context interface implementation check to tests
2016-12-05 10:55:06 +01:00
Bo-Yi Wu
6f474cb42d Merge pull request #570 from andreynering/array
Implement QueryArray and PostFormArray methods
2016-12-03 08:12:19 +08:00
Vyacheslav Dubinin
ceb250ba20 Move golang.org/x/net/context.Context interface implementation check to tests 2016-10-19 17:13:38 +03:00
Maxime Soulé
bf8da4a08a Context.Get() does not need to test whether Keys is nil or not 2016-09-09 11:37:22 +02:00
Javier Provecho Fernandez
9e930b9bdd lint code 2016-04-15 01:16:46 +02:00
Javier Provecho Fernandez
4df51ad4f8 Merge pull request #587 from roylou/develop
Write header immediately in AbortWithStatus(), close #585
2016-04-15 00:36:29 +02:00
Javier Provecho
007bd5124a closes #514, code from bobbo@b4f0b50 2016-04-14 23:47:49 +02:00
Roy Lou
4c4444b160 Write header immediately in AbortWithStatus()
Otherwise, caller needs to invoke WriteHeaderNow himself after
AbortWithStatus(), which is error-prone.

Also modified ErrorLoggerT() such that it always writes log to response
body. Otherwise calling AbortWithStatus() will fail to write body because
c.Writer.Written() is set true by WriteHeaderNow().
2016-04-15 00:02:29 +08:00
Kamron Batman
70c104e16c [Cleanup] Typo in context.go
Fixes typo from 'If Parses' to 'It parses'
2016-04-01 16:29:28 -07:00
Andrey Nering
f3ff8f827c Refactor GetQuery and GetPostForm 2016-03-29 21:54:21 -03:00
Andrey Nering
9366e33ffc Implement QueryArray and PostArray methods 2016-03-29 21:48:50 -03:00
Michael Puncel
7171b967a3 s/currect/current 2016-03-07 21:56:46 -08:00
Michael Puncel
13565e1bf5 fix typo in godoc for func (*Context) HandlerName 2016-03-07 20:54:10 -08:00
Manu Mtz.-Almeida
44978ff780 Improves Context documentation
Query(), GetQuery(), PostForm(), GetPostForm()...
2016-01-29 02:42:19 +01:00
Manu Mtz.-Almeida
afc499f306 Adds GetQuery() and GetPostForm() APIs 2016-01-29 02:07:44 +01:00
Manu Mtz.-Almeida
d64a1fb91c Cosmetic changes 2016-01-28 00:35:09 +01:00
Manu Mtz.-Almeida
61fae4997d Improves documentation 2016-01-26 22:40:29 +01:00
Manu Mtz.-Almeida
e9531e5c76 Merge branch 'master' into develop 2016-01-26 20:08:28 +01:00
Manu Mtz.-Almeida
e6d563577d Merge branch 'master' of github.com:gin-gonic/gin 2016-01-26 20:08:14 +01:00
Manu Mtz.-Almeida
4c639a5049 Cosmetic changes:
- Deprecating GetCookie()
2016-01-26 18:36:37 +01:00
Manu Mtz.-Almeida
2fc2a3e782 Rendering error throws a panic() 2016-01-26 18:35:04 +01:00
Manu Mtz.-Almeida
9abb909731 Merge branch 'master' into develop 2016-01-26 15:55:44 +01:00
Manu Mtz.-Almeida
7b4e9a81a5 Cosmetic changes 2016-01-26 15:55:30 +01:00
Manu Mtz.-Almeida
d0cd8b9fd9 Adds Status() method to Context 2016-01-26 14:55:45 +01:00
Brian Wigginton
353fa14750 additional clarification 2015-10-27 12:26:05 -05:00
Brian Wigginton
1541a141ee update docs for context.Abort
The docs were a little unclear as to how to use Abort, and how it will affect the current handler.
2015-10-27 12:22:18 -05:00
Javier Provecho Fernandez
4892650ef8 Merge branch 'se77en-master' into develop 2015-10-02 12:38:32 +02:00
Javier Provecho Fernandez
8e37eb8498 Fix tests for GetCookie() and SetCookie() 2015-10-02 12:37:51 +02:00
Javier Provecho Fernandez
45b72951af Merge branch 'master' of https://github.com/se77en/gin into se77en-master 2015-10-02 11:25:25 +02:00
Javier Provecho Fernandez
558d6b582f Merge branch 'fix' of https://github.com/donnpebe/gin into donnpebe-fix 2015-10-02 09:54:06 +02:00
Damon Zhao
e1d27558b3 add parameters for set cookie 2015-09-08 15:37:20 +08:00
Damon Zhao
f5b1fb44bb Add SetCookie and GetCookie method for Context 2015-08-27 16:04:50 +08:00
Manu Mtz-Almeida
e8bc8f48e9 Merge branch 'master' into develop
Conflicts:
	README.md
	gin.go
	routergroup.go
2015-08-16 18:38:13 +02:00
Manu Mtz-Almeida
5f2f8d9cb4 Better documentation 2015-07-05 03:26:30 +02:00
Javier Provecho Fernandez
7c0c427b2d Fix #252 typo (middlewares -> middleware) 2015-07-03 20:12:01 +02:00
Manu Mtz-Almeida
8f3047814e Comments + IRoutes + IRouter + unexported AbortIndex 2015-07-02 20:24:54 +02:00
Manu Mtz-Almeida
16b08c41c9 Merge branch 'fix_is_aborted_method' of https://github.com/adwinsky/gin 2015-07-02 18:42:41 +02:00
Manu Mtz-Almeida
a20984c2bc Adds comments 2015-07-02 18:42:33 +02:00
Adam Dratwinski
74f5051cb5 Fix IsAborted() method 2015-07-02 13:37:11 +02:00
Donn Pebe
c1719f7e20 Use only the ip part of request RemoteAddr 2015-07-02 01:48:21 +07:00
Manu Mtz-Almeida
95c08d5f84 Adds HandlerName() 2015-06-25 19:44:52 +02:00
Manu Mtz-Almeida
58b5e15870 Adds ForwardedByClientIP option 2015-06-07 13:51:13 +02:00
Manu Mtz-Almeida
70325deb98 c.ClientIP() performance improvement
benchmark                 old ns/op     new ns/op     delta
BenchmarkManyHandlers     4956          4463          -9.95%

benchmark                 old allocs     new allocs     delta
BenchmarkManyHandlers     16             13             -18.75%

benchmark                 old bytes     new bytes     delta
BenchmarkManyHandlers     256           216           -15.62%
2015-06-04 13:15:22 +02:00
Manu Mtz-Almeida
822b995687 c.JSON performance improvement
benchmark                 old ns/op     new ns/op     delta
BenchmarkOneRouteJSON     1143          1053          -7.87%

benchmark                 old allocs     new allocs     delta
BenchmarkOneRouteJSON     4              3              -25.00%

benchmark                 old bytes     new bytes     delta
BenchmarkOneRouteJSON     72            56            -22.22%
2015-06-04 13:08:29 +02:00
Manu Mtz-Almeida
56683d33b1 c.String() performance improvements
```
benchmark                   old ns/op     new ns/op     delta
BenchmarkOneRouteString     448           310           -30.80%

benchmark                   old allocs     new allocs     delta
BenchmarkOneRouteString     1              0              -100.00%

benchmark                   old bytes     new bytes     delta
BenchmarkOneRouteString     48            0             -100.00%
```
2015-06-04 12:53:42 +02:00