Commit Graph

227 Commits

Author SHA1 Message Date
田欧 9666ba6738 chore: update top bar header (#1461) 2018-08-07 13:49:31 +08:00
田欧 647535cd9b Support map as query string or post form parameters (#1383)
* support query map

* add GetQueryMap and unittest

* support post-form map

* add readme for query map

* attempt to fix bug for post-form map when go version is 1.6

* remove duplicate code

* remove comment
2018-08-06 12:07:11 +08:00
Rex Lee(李俊) 85221af84c add json ASCII string render (#1358)
add a json render that rendering json as ASCII string
2018-07-03 17:17:08 +08:00
田欧 c00f21ff23 add go version prerequisite and debug warning (#1394)
* add go version prerequisite and debug warning

* merge duplicate content

* remove duplicate content
2018-06-26 18:56:43 +08:00
htobenothing bf85b32c1d Add Pusher() function for support http2 server push (#1273)
gin already support http2, while previously not support server push.
Add Pusher() function to extend the ResponseWriter interface.

```golang
// get http.Pusher
 if pusher := c.Writer.Pusher(); pusher != nil {
     // use pusher.Push() to do server push
}
```
<img width="881" alt="screen shot 2018-03-07 at 11 20 49 pm" src="https://user-images.githubusercontent.com/16014993/37100619-680c00c6-225e-11e8-9352-76ec3bd62894.png">
2018-06-21 09:53:52 +08:00
田欧 caf3e350a5 doc: update readme for adding binding about skip validate (#1359)
* update readme for adding binding about skip validate

* update readme for adding binding about skip validate
2018-05-31 14:13:40 +08:00
chainhelen 07cbe116a0 Add and fix the explanation of `HandleContext` (#1371)
Reference this issue #1323 

1. There isn't any eg about `HandleContext`  
2. The `c.Request.Path`  of `HandleContext` Comment  is not right   

Based on the above two points, I pull this request.  
If you think it's unnecessary, I will close this.  
Thx.
2018-05-30 09:19:04 +08:00
Jean-Christophe Lebreton bf7803815b Serve easily dynamic files with `DataFromReader` context method (#1304)
* Add DataFromReader context method

* Replace fmt by strconv.FormatInt

* Add pull request link to README
2018-05-12 11:00:42 +08:00
JINNOUCHI Yasushi 995fa8e9ce Fix #216: Enable to call binding multiple times in some formats (#1341)
* Add interface to read body bytes in binding

* Add BindingBody implementation for some binding

* Fix to use `BindBodyBytesKey` for key

* Revert "Fix to use `BindBodyBytesKey` for key"

This reverts commit 2c82901cea.

* Use private-like key for body bytes

* Add tests for BindingBody & ShouldBindBodyWith

* Add note for README

* Remove redundant space between sentences
2018-05-11 10:33:33 +08:00
田欧 bd4f73af67 support struct pointer (#1342)
* support struct pointer

* add readme
2018-05-01 14:24:18 +08:00
senhtry 8c24018290 Add Jsonp Support to Context (#1333) 2018-04-26 11:52:19 +08:00
JINNOUCHI Yasushi 814ac9490a Add example to build single binary with templates (#1328) 2018-04-22 15:04:38 +08:00
田欧 248c522e4a Add Contents for README because it too long (#1325) 2018-04-20 09:54:00 +08:00
Suhas Karanth 6d913fc343 fix(binding): Expose validator engine used by the default Validator (#1277)
* fix(binding): Expose validator engine used by the default Validator

- Add func ValidatorEngine for returning the underlying validator engine used
  in the default StructValidator implementation.
- Remove the function RegisterValidation from the StructValidator interface
  which made it immpossible to use a StructValidator implementation without the
  validator.v8 library.
- Update and rename test for registering validation
  Test{RegisterValidation => ValidatorEngine}.
- Update readme and example for registering custom validation.
- Add example for registering struct level validation.
- Add documentation for the following binding funcs/types:
  - Binding interface
  - StructValidator interface
  - Validator instance
  - Binding implementations
  - Default func

* fix(binding): Move validator engine getter inside interface

* docs: rm date cmd from custom validation demo
2018-03-29 14:33:07 +08:00
Romain Beuque 3e3f9bca81 doc(graceful-shutdown): failure to ListenAndServe should be a reason to exit (#1287)
Signed-off-by: Romain Beuque <romain.beuque@gmail.com>
2018-03-20 14:05:24 +08:00
README Bot cbb1ee80b1 Add CodeTriage badge to gin-gonic/gin (#1249)
Adds a badge showing the number of people helping this repo on CodeTriage.

[![Open Source Helpers](https://www.codetriage.com/gin-gonic/gin/badges/users.svg)](https://www.codetriage.com/gin-gonic/gin)

## What is CodeTriage?

CodeTriage is an Open Source app that is designed to make contributing to Open Source projects easier. It works by sending subscribers a few open issues in their inbox. If subscribers get busy, there is an algorithm that backs off issue load so they do not get overwhelmed

[Read more about the CodeTriage project](https://www.codetriage.com/what).

## Why am I getting this PR?

Your project was picked by the human, @schneems. They selected it from the projects submitted to https://www.codetriage.com and hand edited the PR. How did your project get added to [CodeTriage](https://www.codetriage.com/what)? Roughly 6 months ago, [dinsaw](https://github.com/dinsaw) added this project to CodeTriage in order to start contributing. Since then, 5 people have subscribed to help this repo.

## What does adding a badge accomplish?

Adding a badge invites people to help contribute to your project. It also lets developers know that others are invested in the longterm success and maintainability of the project.

You can see an example of a CodeTriage badge on these popular OSS READMEs:

- [![](https://www.codetriage.com/rails/rails/badges/users.svg)](https://www.codetriage.com/rails/rails) https://github.com/rails/rails
- [![](https://www.codetriage.com/crystal-lang/crystal/badges/users.svg)](https://www.codetriage.com/crystal-lang/crystal) https://github.com/crystal-lang/crystal

## Have a question or comment?

While I am a bot, this PR was manually reviewed and monitored by a human - @schneems. My job is writing commit messages and handling PR logistics.

If you have any questions, you can reply back to this PR and they will be answered by @schneems. If you do not want a badge right now, no worries, close the PR, you will not hear from me again.

Thanks for making your project Open Source! Any feedback is greatly appreciated.
2018-02-22 21:28:50 +08:00
MW Lim 7a9a290b36 minor typo in README.md (#1219) 2018-01-23 10:36:36 +08:00
Kevin Zhu 8a6792d516 Fix README.md example code (#1231)
r -> router
2018-01-23 10:07:33 +08:00
Levi Olson 05547037e4 Minor grammatical correction in README (#1206) 2017-12-21 10:48:11 +08:00
TaeJun Park 25e7cd75ed Update README.md (#1188)
change path from '~/go/...' to '$GOPATH/...'
2017-12-17 08:05:30 +08:00
Max Hilbrunner 13a40fcd2c README: Small update to clarify on Goroutines (#1199) 2017-12-17 00:52:07 +08:00
Boris Borshevsky 6f94fd05c9 Linting and optimizing struct memory signature. (#1184)
* fix cleanPath spell (#969)

* linter and optimize structs
2017-11-29 10:50:14 +08:00
Richard Lee ae9f03e6e8 Fix up syntax error in README (#1155) 2017-11-11 23:56:59 -06:00
Andrii Bubis 80f691159f Added simple testing documentation and examples (#1156) 2017-11-11 23:37:32 -06:00
田欧 9ae1e5db2a add package for govendor (#1166)
* add package for govendor

* fix vet error.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* add missing example.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update gin-gonic/autotls

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-11 23:11:22 -06:00
田欧 6653d5d588 fix markdown render (#1149) 2017-10-29 21:38:38 -05:00
Suhas Karanth dfb68ce085 feat(context): ShouldBind counterparts for Bind methods (#1047)
* feat(context): ShouldBind counterparts for Bind methods + tests

* docs(readme): Switch examples to use ShouldBind methods

Add section for bind methods types, explain difference in behavior.
Switch all `c.Bind` examples to use `c.ShouldBind`.
2017-10-23 11:14:09 +02:00
Bo-Yi Wu b8b68314fa feat: add multiple service example. (#1119) 2017-09-29 16:48:10 +08:00
Kristoffer A. Iversen 8c17c680d9 Fixed README.md typo (#1104)
* Fixed README.md typo

* Fixed example typo

* Fixed example typo
2017-09-11 22:17:26 +08:00
Daniel M. Lambea c9b344118f Moved const 'defaultMemory' to attrib. Engine.MaxMultipartMemory instead. (#1100) 2017-09-07 11:45:16 +08:00
Suhas Karanth 26c3f42095 feat(binding): add support for custom validator / validation tags (#1068)
* feat(binding): Add support for custom validation tags

* docs: Add example for custom validation tag

* test(binding): Add test for registering custom validation
2017-08-27 09:37:39 +02:00
stackerzzq bc538849eb Update readme for adding tag example of binding time field (#1080) 2017-08-24 20:06:13 -05:00
Eason Lin 80152ac82c doc(readme): update writing logs section wording. (#1074)
* doc(readme): update writing logs section wording.

* doc(readme): update writing logs section wording.

* doc(readme): fix word formatting
2017-08-23 21:50:31 -05:00
田欧 8be30bd382 Update readme for showing output log to file (#1073)
* Update readme for showing output log to file

* update indent
2017-08-22 13:55:32 +08:00
Eason Lin 3856206bd0 doc(readme): add additional middleware doc. (#1056) 2017-08-17 12:18:50 +08:00
田欧 d39ed41ab3 update template example (#1038)
* update template example

* add template example folder
2017-07-20 21:29:23 -05:00
Eason Lin c19aa0598b feat(context): add BindQuery func (#1029)
* feat(context): add BindQuery func, only parse/bind the query string params.

* docs(readme): add BindQuery section.

* docs(readme): fix import.

* docs(readme): separate import
2017-07-19 09:50:05 +02:00
Bo-Yi Wu 74221b8a35 docs(benchmark): update benchmark data (#1035)
* feat(Benchmark): update benchmark data

* fix format.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* docs(benchmarks): re indent column, feature gin

* docs(benchmark): fix newline on vm details

* docs(readme): beautify bench table, explain result
2017-07-19 09:40:05 +02:00
Bo-Yi Wu ce670a6497 refactor(json): make jsonite optional with build tags (#1026)
* refactor(json): Restore gin support for app engine

Create new folder to support multiple json package.
restore gin support for app engine (disable jsonite through tags)

use jsoniter

$ go build -tags=jsoniter .

use default json

$ go build .

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* rename json file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* docs(json): add build tags document.

* fix(docs): markdown format.

* fix(json): missing space.
2017-07-18 23:01:29 +02:00
Eason Lin 30cfa590bb dos(upload): fix alignment (#1030) 2017-07-17 20:23:10 -05:00
Javier Provecho Fernandez 8678b3df96 docs(readme): add reference to validator.v8 docs, close #738 (#1024) 2017-07-16 19:50:45 -05:00
Eason Lin 93b3a0d7ec feat(context): add SaveUploadedFile func. (#1022)
* feat(context): add SaveUploadedFile func.

* feat(context): update multiple upload examples.

* style(example): fix gofmt

* fix(example): add missing return
2017-07-15 22:42:08 -05:00
Eason Lin 5cb25a6410 docs(readme): fix multiple file example (#1018) 2017-07-14 12:28:16 -05:00
Javier Provecho Fernandez fe4d405108 docs(readme): fix single file example (#1017)
issue discovered by @sgon00 at gitter
2017-07-14 11:52:16 -05:00
Javier Provecho Fernandez df3b79e805 docs(readme): add binding html checkbox example, close #129 (#994) 2017-07-09 11:02:44 +02:00
Eason Lin bf9758ca05 Add SecureJSON doc 2017-07-09 01:54:43 +08:00
Eason Lin b060a5f409 docs(readme): fix code link (#989) 2017-07-08 03:16:59 -05:00
Javier Provecho Fernandez 0c3726b206 docs(readme): remove logo, relink it to gin-gonic/logo 2017-07-07 09:21:44 +02:00
Javier Provecho Fernandez 7387ef60be docs(readme): add badge for projects who use gin 2017-07-06 08:53:48 +02:00
Javier Provecho Fernandez ff5788bfdd docs(readme): upload full size logo 2017-07-06 08:41:27 +02:00