1. 14 8月, 2018 3 次提交
  2. 13 8月, 2018 1 次提交
  3. 12 8月, 2018 5 次提交
  4. 10 8月, 2018 1 次提交
  5. 09 8月, 2018 1 次提交
  6. 07 8月, 2018 3 次提交
  7. 06 8月, 2018 2 次提交
  8. 05 8月, 2018 1 次提交
  9. 21 7月, 2018 1 次提交
  10. 03 7月, 2018 2 次提交
  11. 02 7月, 2018 1 次提交
  12. 01 7月, 2018 1 次提交
  13. 28 6月, 2018 1 次提交
  14. 26 6月, 2018 2 次提交
  15. 23 6月, 2018 3 次提交
  16. 22 6月, 2018 2 次提交
  17. 21 6月, 2018 2 次提交
    • H
      Add Pusher() function for support http2 server push (#1273) · bf85b32c
      htobenothing 提交于
      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">
      bf85b32c
    • utils: use strings.Split instead of strings.IndexByte (#1400) · 87d536c0
      田欧 提交于
      And I test them benchmark:
      
      code:
      
      ```go
      # stringsbench.go
      package stringsbench
      
      import "strings"
      
      func index(part string) string {
      	if index := strings.IndexByte(part, ';'); index >= 0 {
      		if part := strings.TrimSpace(strings.Split(part, ";")[0]); part != "" {
      			return part[0:index]
      		}
      	}
      	return ""
      }
      
      func split(part string) string {
      	return strings.Split(part, ";")[0]
      }
      ```
      
      ```go
      # stringsbench_test.go
      package stringsbench
      
      import (
      	"testing"
      )
      
      func BenchmarkIndex(b *testing.B) {
      	b.RunParallel(func(pb *testing.PB) {
      		for pb.Next() {
      			index("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
      		}
      	})
      }
      
      func BenchmarkSplit(b *testing.B) {
      	b.RunParallel(func(pb *testing.PB) {
      		for pb.Next() {
      			split("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
      		}
      	})
      }
      ```
      
      And the result:
      
      ```shell
      ➜  strings go test --bench=.
      goos: darwin
      goarch: amd64
      BenchmarkIndex-8   	30000000	        46.1 ns/op
      BenchmarkSplit-8   	50000000	        35.9 ns/op
      PASS
      ok  	_/Users/tianou/strings	3.271s
      ➜  strings go test --bench=.
      goos: darwin
      goarch: amd64
      BenchmarkIndex-8   	30000000	        44.2 ns/op
      BenchmarkSplit-8   	50000000	        34.7 ns/op
      PASS
      ok  	_/Users/tianou/strings	3.156s
      ➜  strings go test --bench=.
      goos: darwin
      goarch: amd64
      BenchmarkIndex-8   	30000000	        45.6 ns/op
      BenchmarkSplit-8   	50000000	        35.3 ns/op
      PASS
      ok  	_/Users/tianou/strings	3.230s
      ```
      87d536c0
  18. 31 5月, 2018 2 次提交
  19. 30 5月, 2018 1 次提交
    • C
      Add and fix the explanation of `HandleContext` (#1371) · 07cbe116
      chainhelen 提交于
      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. 
      07cbe116
  20. 12 5月, 2018 1 次提交
  21. 11 5月, 2018 3 次提交
  22. 01 5月, 2018 1 次提交