Skip to content

Commit

Permalink
update go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
tsingson committed Apr 4, 2024
1 parent 8e44872 commit c594274
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 540 deletions.
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ step by step to build web application via [fasthttp](https://github.com/valyala/

1. [GopherCon 2019 - How I write HTTP web services after eight years](https://about.sourcegraph.com/go/gophercon-2019-how-i-write-http-web-services-after-eight-years)

1. [chinese guide ----> go语言Fasthttp实践系列(1) helloWorldGetHandler World](https://juejin.im/post/5d446c15e51d4561fd6cb46f)
1. [chinese guide ----> go语言Fasthttp实践系列(1) helloWorldGetHandler World](https://tsingson.github.io/tech/fasthttp01/)

## 0. note

I had built some business project with golang about 5 years. And use fasthttp in different projects over 2 years. fasthttp help to build high performance API server / web server / proxy, etc. I had shared some good practice and experience of fasthttp to friends in tech meet up. It’s excited for me to share something, and friends enjoy on it. So, I write this booklet to help some developer that work in a web application.
I had built some business project with golang about 8 years. And use fasthttp in different projects over 5 years. fasthttp help to build high performance API server / web server / upload serv, etc. I had shared some good practice and experience of fasthttp to friends in tech meet up. It’s excited for me to share something, and friends enjoy on. So, I write this booklet to help some developer that work in a web application.

There are some different between ‘standard’ go net/http and fasthttp. I will clarify the different , show out the How/when/why to use fasthttp. show ideas, basic usage and experience of fasthttp.

Expand Down Expand Up @@ -50,15 +50,9 @@ func (ws *webServer) Run() (err error) {
Logger: lg,
}
// run fasthttp serv
var g run.Group
g.Add(func() error {
return s.Serve(ws.ln)
}, func(e error) {
_ = ws.ln.Close()
})
return g.Run()
return s.Serve(ws.ln)
}
```
Expand Down Expand Up @@ -271,10 +265,10 @@ cd ~
mkdir go-project
cd go-project
git clone https://github.com/tsingson/fasthttp-example
cd ./fasthttp-example
git clone https://github.com/tsingson/fasthttp-guide
cd ./fasthttp-guide
go mod download
go mod tidy
```

### 3.2 **build**
Expand Down Expand Up @@ -534,4 +528,3 @@ cool, just try it by yourself.
MIT

by tsingson 2019

1 change: 0 additions & 1 deletion example/helloworld/hello-web/hello-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func main() {
{
log.Debug("---------------- HTTP header 每一个键值对-------------")
resp.Header.VisitAll(func(key, value []byte) {

log.Debug(tid, zap.String("key", vtils.B2S(key)), zap.String("value", vtils.B2S(value)))
})

Expand Down
39 changes: 18 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
module github.com/tsingson/fasthttp-guide

go 1.17
go 1.22

require (
github.com/buaazp/fasthttprouter v0.1.1
github.com/fasthttp/router v1.4.6
github.com/prometheus/client_golang v1.12.1
github.com/sanity-io/litter v1.5.2
github.com/stretchr/testify v1.7.0
github.com/valyala/fasthttp v1.33.0
go.uber.org/zap v1.21.0
github.com/fasthttp/router v1.5.0
github.com/prometheus/client_golang v1.19.0
github.com/sanity-io/litter v1.5.5
github.com/stretchr/testify v1.8.1
github.com/valyala/fasthttp v1.52.0
go.uber.org/zap v1.27.0
)

require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/klauspost/compress v1.14.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.51.0 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sys v0.18.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit c594274

Please sign in to comment.