Skip to content
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.

Commit

Permalink
chore: update go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Dec 7, 2019
1 parent 373a321 commit fc76e89
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func main() {
return
})

d.ListenAndServe(":7001")
d.ListenAndServe(":3000")
}
```

Expand All @@ -44,7 +44,7 @@ create a new gzip decoder

```go
conf := bodyparser.Config{}
conf.AddDecoder(NewGzipDecoder())
conf.AddDecoder(bodyparser.NewGzipDecoder())
d.Use(bodyparser.New(conf))
```

Expand All @@ -54,7 +54,7 @@ create a new json decoder

```go
conf := bodyparser.Config{}
conf.AddDecoder(NewJSONDecoder())
conf.AddDecoder(bodyparser.NewJSONDecoder())
d.Use(bodyparser.New(conf))
```

Expand All @@ -63,7 +63,9 @@ d.Use(bodyparser.New(conf))
create a new form url encoded decoder

```go
conf := bodyparser.Config{}
conf.AddDecoder(NewFormURLEncodedDecoder())
conf := bodyparser.Config{
ContentTypeValidate: bodyparser.DefaultJSONAndFormContentTypeValidate
}
conf.AddDecoder(bodyparser.NewFormURLEncodedDecoder())
d.Use(bodyparser.New(conf))
```
24 changes: 24 additions & 0 deletions example/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"bytes"

"github.com/vicanso/elton"
bodyparser "github.com/vicanso/elton-body-parser"
)

func main() {
d := elton.New()

d.Use(bodyparser.NewDefault())

d.POST("/user/login", func(c *elton.Context) (err error) {
c.BodyBuffer = bytes.NewBuffer(c.RequestBody)
return
})

err := d.ListenAndServe(":3000")
if err != nil {
panic(err)
}
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/vicanso/elton-body-parser
go 1.12

require (
github.com/stretchr/testify v1.3.0
github.com/vicanso/elton v0.2.0
github.com/stretchr/testify v1.4.0
github.com/vicanso/elton v0.2.2
github.com/vicanso/hes v0.2.1
)
20 changes: 11 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/vicanso/elton v0.1.1 h1:l4dbZSGhGRVnrxLbArC/60GXNxDo0O/RlY5z4iHSa7I=
github.com/vicanso/elton v0.1.1/go.mod h1:T5GOazXuYrwwE1qMA0G3zka7NVwwkoL2fYIWNfeEpJw=
github.com/vicanso/elton v0.2.0 h1:QlXgmq6m+9wZN7FeLD25/EhBkl8blzppviVY5U5PTm0=
github.com/vicanso/elton v0.2.0/go.mod h1:ynAUOSkZQ+pFaUsxlG5hYnJFjPpMwz8YyEBPzNh0pSg=
github.com/vicanso/hes v0.1.4 h1:n8kG8krvNJF4Sj1PvZOEUzdUsmDSbCcGr8C1nYnoP+o=
github.com/vicanso/hes v0.1.4/go.mod h1:bG0UJ3EihDKObFcLLwJYjxHHr9saFllsFcepyDIvFlo=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/vicanso/elton v0.2.2 h1:MZ5nfJFKBWDWnFPO8wRyPat8kZz3KoNBY0scemo7RFQ=
github.com/vicanso/elton v0.2.2/go.mod h1:QFZ+Un4LLBANtl0mExkqLD4uqw3JLA2ZCWUHaCsHOUg=
github.com/vicanso/hes v0.2.1 h1:jRFEADmiQ30koVY/sKwlkhyXM5B3QbVVizLqrjNJgPw=
github.com/vicanso/hes v0.2.1/go.mod h1:QcxOFmFfBQMhASTaLgnFayXYCgevdSeBVprt+o+3eKo=
github.com/vicanso/intranet-ip v0.0.1 h1:cYS+mExFsKqewWSuHtFwAqw/CO66GsheB/P1BPmSTx0=
github.com/vicanso/intranet-ip v0.0.1/go.mod h1:bqQ6VUhxdz0ipSb1kzd6aoZStlp+pB7CTlVmVhgLAxA=
github.com/vicanso/keygrip v0.1.0 h1:/zYzoVIbREAvaxSM7bo3/oSXuuYztaP71dPBfhRoNkM=
github.com/vicanso/keygrip v0.1.0/go.mod h1:cI05iOjY00NJ7oH2Z9Zdm9eJPUkpoex3XnEubK78nho=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 comments on commit fc76e89

Please sign in to comment.